Committed William Osborne's wxPalmOS port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
#include <signal.h> // for SIGTRAP used by wxTrap()
|
||||
#endif //Win/Unix
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/wrapwin.h" // includes windows.h for MessageBox()
|
||||
#endif
|
||||
|
||||
@@ -140,11 +140,13 @@ bool wxAppConsole::Initialize(int& argc, wxChar **argv)
|
||||
this->argc = argc;
|
||||
this->argv = argv;
|
||||
|
||||
#ifndef __PALMOS__
|
||||
if ( m_appName.empty() && argv )
|
||||
{
|
||||
// the application name is, by default, the name of its executable file
|
||||
wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "wx/utils.h"
|
||||
#include "wx/ptr_scpd.h"
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/private.h" // includes windows.h for LOGFONT
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "wx/paper.h"
|
||||
#endif // wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include <windowsx.h>
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
||||
|
||||
wxWindow *child = node->GetData();
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
bool is_not_msw_rb = !m_winLastFocused ||
|
||||
!wxIsKindOf(m_winLastFocused,wxRadioButton);
|
||||
#else
|
||||
@@ -306,7 +306,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
||||
// direction we're coming
|
||||
event.SetEventObject(m_winParent);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
// we need to hop to the next activated
|
||||
// radio button, not just the next radio
|
||||
// button under MSW
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/private.h" // includes windows.h for LOGFONT
|
||||
#include "wx/msw/winundef.h"
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "wx/log.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/wrapwin.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -433,6 +433,8 @@ int wxEntry(int& argc, wxChar **argv)
|
||||
{
|
||||
#ifdef __WXWINCE__
|
||||
::ExitThread(3); // the same exit code as abort()
|
||||
#elif __PALMOS__
|
||||
return -1;
|
||||
#else
|
||||
::ExitProcess(3); // the same exit code as abort()
|
||||
#endif
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
#ifdef __WXMAC__
|
||||
@@ -118,7 +118,7 @@ void wxMessageOutputDebug::Printf(const wxChar* format, ...)
|
||||
out.PrintfV(format, args);
|
||||
va_end(args);
|
||||
|
||||
#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
|
||||
#if defined(__WXMSW__) && !defined(__WXMICROWIN__) && !defined(__PALMOS__)
|
||||
out.Replace(wxT("\t"), wxT(" "));
|
||||
out.Replace(wxT("\n"), wxT("\r\n"));
|
||||
::OutputDebugString(out);
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if defined(__WXMSW__) && !defined(__PALMOS__)
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PALMOS__
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "imaglist.h"
|
||||
#endif
|
||||
@@ -190,4 +192,4 @@ bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
#endif // __PALMOS__
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __PALMOS__
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
@@ -705,3 +708,4 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif // __PALMOS__
|
||||
|
||||
97
src/palmos/accel.cpp
Normal file
97
src/palmos/accel.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: accel.cpp
|
||||
// Purpose: wxAcceleratorTable
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "accel.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#endif
|
||||
|
||||
#include "wx/accel.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorRefData: public wxObjectRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxAcceleratorTable;
|
||||
public:
|
||||
wxAcceleratorRefData();
|
||||
~wxAcceleratorRefData();
|
||||
|
||||
inline HACCEL GetHACCEL() const { return m_hAccel; }
|
||||
protected:
|
||||
HACCEL m_hAccel;
|
||||
bool m_ok;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxAcceleratorRefData)
|
||||
};
|
||||
|
||||
#define M_ACCELDATA ((wxAcceleratorRefData *)m_refData)
|
||||
|
||||
wxAcceleratorRefData::wxAcceleratorRefData()
|
||||
{
|
||||
}
|
||||
|
||||
wxAcceleratorRefData::~wxAcceleratorRefData()
|
||||
{
|
||||
}
|
||||
|
||||
wxAcceleratorTable::wxAcceleratorTable()
|
||||
{
|
||||
}
|
||||
|
||||
wxAcceleratorTable::~wxAcceleratorTable()
|
||||
{
|
||||
}
|
||||
|
||||
wxAcceleratorTable::wxAcceleratorTable(const wxString& resource)
|
||||
{
|
||||
}
|
||||
|
||||
extern int wxCharCodeWXToMSW(int id, bool *isVirtual);
|
||||
|
||||
wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[])
|
||||
{
|
||||
}
|
||||
|
||||
bool wxAcceleratorTable::Ok() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxAcceleratorTable::SetHACCEL(WXHACCEL hAccel)
|
||||
{
|
||||
}
|
||||
|
||||
WXHACCEL wxAcceleratorTable::GetHACCEL() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxAcceleratorTable::Translate(wxWindow *window, WXMSG *wxmsg) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
313
src/palmos/app.cpp
Normal file
313
src/palmos/app.cpp
Normal file
@@ -0,0 +1,313 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.cpp
|
||||
// Purpose: wxApp
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/08/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "app.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/wxchar.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/apptrait.h"
|
||||
#include "wx/filename.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/dynlib.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// We don't support OLE
|
||||
#undef wxUSE_OLE
|
||||
#define wxUSE_OLE 0
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
extern wxList WXDLLEXPORT wxPendingDelete;
|
||||
|
||||
// NB: all "NoRedraw" classes must have the same names as the "normal" classes
|
||||
// with NR suffix - wxWindow::MSWCreate() supposes this
|
||||
const wxChar *wxCanvasClassName = wxT("wxWindowClass");
|
||||
const wxChar *wxCanvasClassNameNR = wxT("wxWindowClassNR");
|
||||
const wxChar *wxMDIFrameClassName = wxT("wxMDIFrameClass");
|
||||
const wxChar *wxMDIFrameClassNameNoRedraw = wxT("wxMDIFrameClassNR");
|
||||
const wxChar *wxMDIChildFrameClassName = wxT("wxMDIChildFrameClass");
|
||||
const wxChar *wxMDIChildFrameClassNameNoRedraw = wxT("wxMDIChildFrameClassNR");
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ===========================================================================
|
||||
// wxGUIAppTraits implementation
|
||||
// ===========================================================================
|
||||
|
||||
// private class which we use to pass parameters from BeforeChildWaitLoop() to
|
||||
// AfterChildWaitLoop()
|
||||
struct ChildWaitLoopData
|
||||
{
|
||||
ChildWaitLoopData(wxWindowDisabler *wd_, wxWindow *winActive_)
|
||||
{
|
||||
wd = wd_;
|
||||
winActive = winActive_;
|
||||
}
|
||||
|
||||
wxWindowDisabler *wd;
|
||||
wxWindow *winActive;
|
||||
};
|
||||
|
||||
void *wxGUIAppTraits::BeforeChildWaitLoop()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxGUIAppTraits::AlwaysYield()
|
||||
{
|
||||
wxYield();
|
||||
}
|
||||
|
||||
void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxGUIAppTraits::DoMessageFromThreadWait()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo()
|
||||
{
|
||||
static wxToolkitInfo info;
|
||||
wxToolkitInfo& baseInfo = wxAppTraits::GetToolkitInfo();
|
||||
info.versionMajor = baseInfo.versionMajor;
|
||||
info.versionMinor = baseInfo.versionMinor;
|
||||
info.os = baseInfo.os;
|
||||
info.shortName = _T("msw");
|
||||
info.name = _T("wxMSW");
|
||||
#ifdef __WXUNIVERSAL__
|
||||
info.shortName << _T("univ");
|
||||
info.name << _T("/wxUniversal");
|
||||
#endif
|
||||
return info;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// wxApp implementation
|
||||
// ===========================================================================
|
||||
|
||||
int wxApp::m_nCmdShow = 0;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
||||
EVT_IDLE(wxApp::OnIdle)
|
||||
EVT_END_SESSION(wxApp::OnEndSession)
|
||||
EVT_QUERY_END_SESSION(wxApp::OnQueryEndSession)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// class to ensure that wxAppBase::CleanUp() is called if our Initialize()
|
||||
// fails
|
||||
class wxCallBaseCleanup
|
||||
{
|
||||
public:
|
||||
wxCallBaseCleanup(wxApp *app) : m_app(app) { }
|
||||
~wxCallBaseCleanup() { if ( m_app ) m_app->wxAppBase::CleanUp(); }
|
||||
|
||||
void Dismiss() { m_app = NULL; }
|
||||
|
||||
private:
|
||||
wxApp *m_app;
|
||||
};
|
||||
|
||||
//// Initialize
|
||||
bool wxApp::Initialize(int& argc, wxChar **argv)
|
||||
{
|
||||
if ( !wxAppBase::Initialize(argc, argv) )
|
||||
return false;
|
||||
|
||||
// ensure that base cleanup is done if we return too early
|
||||
wxCallBaseCleanup callBaseCleanup(this);
|
||||
|
||||
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
|
||||
|
||||
callBaseCleanup.Dismiss();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// RegisterWindowClasses
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// TODO we should only register classes really used by the app. For this it
|
||||
// would be enough to just delay the class registration until an attempt
|
||||
// to create a window of this class is made.
|
||||
bool wxApp::RegisterWindowClasses()
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// UnregisterWindowClasses
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxApp::UnregisterWindowClasses()
|
||||
{
|
||||
bool retval = TRUE;
|
||||
return retval;
|
||||
}
|
||||
|
||||
void wxApp::CleanUp()
|
||||
{
|
||||
// all objects pending for deletion must be deleted first, otherwise we
|
||||
// would crash when they use wxWinHandleHash (and UnregisterWindowClasses()
|
||||
// call wouldn't succeed as long as any windows still exist), so call the
|
||||
// base class method first and only then do our clean up
|
||||
wxAppBase::CleanUp();
|
||||
|
||||
// for an EXE the classes are unregistered when it terminates but DLL may
|
||||
// be loaded several times (load/unload/load) into the same process in
|
||||
// which case the registration will fail after the first time if we don't
|
||||
// unregister the classes now
|
||||
UnregisterWindowClasses();
|
||||
|
||||
delete wxWinHandleHash;
|
||||
wxWinHandleHash = NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxApp ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxApp::wxApp()
|
||||
{
|
||||
m_printMode = wxPRINT_WINDOWS;
|
||||
}
|
||||
|
||||
wxApp::~wxApp()
|
||||
{
|
||||
// our cmd line arguments are allocated inside wxEntry(HINSTANCE), they
|
||||
// don't come from main(), so we have to free them
|
||||
|
||||
while ( argc )
|
||||
{
|
||||
// m_argv elements were allocated by wxStrdup()
|
||||
free(argv[--argc]);
|
||||
}
|
||||
|
||||
// but m_argv itself -- using new[]
|
||||
delete [] argv;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxApp idle handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxApp::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
wxAppBase::OnIdle(event);
|
||||
}
|
||||
|
||||
void wxApp::WakeUpIdle()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// other wxApp event hanlders
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
if (GetTopWindow())
|
||||
GetTopWindow()->Close(TRUE);
|
||||
}
|
||||
|
||||
// Default behaviour: close the application with prompts. The
|
||||
// user can veto the close, and therefore the end session.
|
||||
void wxApp::OnQueryEndSession(wxCloseEvent& event)
|
||||
{
|
||||
if (GetTopWindow())
|
||||
{
|
||||
if (!GetTopWindow()->Close(!event.CanVeto()))
|
||||
event.Veto(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// miscellaneous
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* static */
|
||||
int wxApp::GetComCtl32Version()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Yield to incoming messages
|
||||
|
||||
bool wxApp::Yield(bool onlyIfNeeded)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#if wxUSE_EXCEPTIONS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// exception handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxApp::OnExceptionInMainLoop()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_EXCEPTIONS
|
||||
55
src/palmos/base.cpp
Normal file
55
src/palmos/base.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/basemsw.cpp
|
||||
// Purpose: misc stuff only used in applications under PalmOS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.2004
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) 2004 William Osborne
|
||||
// License: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/apptrait.h"
|
||||
|
||||
#include "wx/recguard.h"
|
||||
|
||||
// ============================================================================
|
||||
// wxConsoleAppTraits implementation
|
||||
// ============================================================================
|
||||
|
||||
void wxConsoleAppTraits::AlwaysYield()
|
||||
{
|
||||
}
|
||||
|
||||
void *wxConsoleAppTraits::BeforeChildWaitLoop()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxConsoleAppTraits::AfterChildWaitLoop(void * WXUNUSED(data))
|
||||
{
|
||||
}
|
||||
|
||||
bool wxConsoleAppTraits::DoMessageFromThreadWait()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
525
src/palmos/bitmap.cpp
Normal file
525
src/palmos/bitmap.cpp
Normal file
@@ -0,0 +1,525 @@
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.cpp
|
||||
// Purpose: wxBitmap
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/08/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "bitmap.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/palette.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
#include "wx/palmos/dib.h"
|
||||
#endif
|
||||
|
||||
#include "wx/image.h"
|
||||
#include "wx/xpmdecod.h"
|
||||
|
||||
#ifdef wxHAVE_RAW_BITMAP
|
||||
#include "wx/rawbmp.h"
|
||||
#endif
|
||||
|
||||
// missing from mingw32 header
|
||||
#ifndef CLR_INVALID
|
||||
#define CLR_INVALID ((COLORREF)-1)
|
||||
#endif // no CLR_INVALID
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Bitmap data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapRefData : public wxGDIImageRefData
|
||||
{
|
||||
public:
|
||||
wxBitmapRefData();
|
||||
virtual ~wxBitmapRefData() { Free(); }
|
||||
|
||||
virtual void Free();
|
||||
|
||||
// set the mask object to use as the mask, we take ownership of it
|
||||
void SetMask(wxMask *mask)
|
||||
{
|
||||
delete m_bitmapMask;
|
||||
m_bitmapMask = mask;
|
||||
}
|
||||
|
||||
// return the mask
|
||||
wxMask *GetMask() const { return m_bitmapMask; }
|
||||
|
||||
public:
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette m_bitmapPalette;
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
wxDC *m_selectedInto;
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
wxDIB *m_dib;
|
||||
#endif
|
||||
|
||||
bool m_hasAlpha;
|
||||
|
||||
bool m_isDIB;
|
||||
|
||||
private:
|
||||
wxMask *m_bitmapMask;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxBitmapRefData)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_WXDIB
|
||||
#define NEVER_USE_DIB
|
||||
#else
|
||||
static inline bool wxShouldCreateDIB(int w, int h, int d, WXHDC hdc)
|
||||
{
|
||||
// here is the logic:
|
||||
//
|
||||
// (a) if hdc is specified, the caller explicitly wants DDB
|
||||
// (b) otherwise, create a DIB if depth >= 24 (we don't support 16bpp
|
||||
// or less DIBs anyhow)
|
||||
// (c) finally, create DIBs under Win9x even if the depth hasn't been
|
||||
// explicitly specified but the current display depth is 24 or
|
||||
// more and the image is "big", i.e. > 16Mb which is the
|
||||
// theoretical limit for DDBs under Win9x
|
||||
//
|
||||
// consequences (all of which seem to make sense):
|
||||
//
|
||||
// (i) by default, DDBs are created (depth == -1 usually)
|
||||
// (ii) DIBs can be created by explicitly specifying the depth
|
||||
// (iii) using a DC always forces creating a DDB
|
||||
return !hdc &&
|
||||
(d >= 24 ||
|
||||
(d == -1 &&
|
||||
wxDIB::GetLineSize(w, wxDisplayDepth())*h > 16*1024*1024));
|
||||
}
|
||||
|
||||
#define SOMETIMES_USE_DIB
|
||||
#endif // different DIB usage scenarious
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapRefData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBitmapRefData::wxBitmapRefData()
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
m_selectedInto = NULL;
|
||||
#endif
|
||||
m_bitmapMask = NULL;
|
||||
|
||||
m_hBitmap = (WXHBITMAP) NULL;
|
||||
#if wxUSE_WXDIB
|
||||
m_dib = NULL;
|
||||
#endif
|
||||
|
||||
m_isDIB =
|
||||
m_hasAlpha = FALSE;
|
||||
}
|
||||
|
||||
void wxBitmapRefData::Free()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmap creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this function should be called from all wxBitmap ctors
|
||||
void wxBitmap::Init()
|
||||
{
|
||||
}
|
||||
|
||||
wxGDIImageRefData *wxBitmap::CreateData() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif // Win32
|
||||
|
||||
bool wxBitmap::CopyFromCursor(const wxCursor& cursor)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef NEVER_USE_DIB
|
||||
|
||||
bool wxBitmap::CopyFromDIB(const wxDIB& dib)
|
||||
{
|
||||
return FALSE:
|
||||
}
|
||||
|
||||
#endif // NEVER_USE_DIB
|
||||
|
||||
wxBitmap::~wxBitmap()
|
||||
{
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// Create from XPM data
|
||||
#if wxUSE_IMAGE && wxUSE_XPM
|
||||
bool wxBitmap::CreateFromXpm(const char **data)
|
||||
#else
|
||||
bool wxBitmap::CreateFromXpm(const char **WXUNUSED(data))
|
||||
#endif
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(int w, int h, int d)
|
||||
{
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
|
||||
{
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
|
||||
{
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxBitmap::Create(int width, int height, int depth)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::Create(int width, int height, const wxDC& dc)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxImage to/from conversions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
|
||||
bool wxBitmap::CreateFromImage(const wxImage& image, int depth)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxImage wxBitmap::ConvertToImage() const
|
||||
{
|
||||
wxImage image;
|
||||
return image;
|
||||
}
|
||||
|
||||
#endif // wxUSE_WXDIB
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// loading and saving bitmaps
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmap::SaveFile(const wxString& filename,
|
||||
int type,
|
||||
const wxPalette *palette)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// sub bitmap extraction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
{
|
||||
wxBitmap ret( 0, 0 );
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmap accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxPalette* wxBitmap::GetPalette() const
|
||||
{
|
||||
return (wxPalette *) NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxMask *wxBitmap::GetMask() const
|
||||
{
|
||||
return (wxMask *) NULL;
|
||||
}
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
|
||||
wxDC *wxBitmap::GetSelectedInto() const
|
||||
{
|
||||
return (wxDC *) NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
int wxBitmap::GetQuality() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
void wxBitmap::UseAlpha()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxBitmap::HasAlpha() const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmap setters
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
|
||||
void wxBitmap::SetSelectedInto(wxDC *dc)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
|
||||
void wxBitmap::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
void wxBitmap::SetMask(wxMask *mask)
|
||||
{
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
void wxBitmap::SetQuality(int WXUNUSED(quality))
|
||||
{
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// raw bitmap access support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef wxHAVE_RAW_BITMAP
|
||||
void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxBitmap::UngetRawData(wxPixelDataBase& dataBase)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif // #ifdef wxHAVE_RAW_BITMAP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMask
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxMask::wxMask()
|
||||
{
|
||||
m_maskBitmap = 0;
|
||||
}
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
}
|
||||
|
||||
// Construct a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
|
||||
{
|
||||
}
|
||||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask::wxMask(const wxBitmap& bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
wxMask::~wxMask()
|
||||
{
|
||||
}
|
||||
|
||||
// Create a mask from a mono bitmap (copies the bitmap).
|
||||
bool wxMask::Create(const wxBitmap& bitmap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Create a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Create a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapHandler
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxBitmapHandler::Create(wxGDIImage *image,
|
||||
void *data,
|
||||
long flags,
|
||||
int width, int height, int depth)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::Load(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
long flags,
|
||||
int width, int height)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::Save(wxGDIImage *image,
|
||||
const wxString& name,
|
||||
int type)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
|
||||
void *WXUNUSED(data),
|
||||
long WXUNUSED(type),
|
||||
int WXUNUSED(width),
|
||||
int WXUNUSED(height),
|
||||
int WXUNUSED(depth))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap),
|
||||
const wxString& WXUNUSED(name),
|
||||
long WXUNUSED(type),
|
||||
int WXUNUSED(desiredWidth),
|
||||
int WXUNUSED(desiredHeight))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap),
|
||||
const wxString& WXUNUSED(name),
|
||||
int WXUNUSED(type),
|
||||
const wxPalette *WXUNUSED(palette))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
139
src/palmos/bmpbuttn.cpp
Normal file
139
src/palmos/bmpbuttn.cpp
Normal file
@@ -0,0 +1,139 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/bmpbuttn.cpp
|
||||
// Purpose: wxBitmapButton
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_BMPBUTTON
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
WX_DEFINE_FLAGS( wxBitmapButtonStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxBitmapButtonStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxBU_AUTODRAW)
|
||||
wxFLAGS_MEMBER(wxBU_LEFT)
|
||||
wxFLAGS_MEMBER(wxBU_RIGHT)
|
||||
wxFLAGS_MEMBER(wxBU_TOP)
|
||||
wxFLAGS_MEMBER(wxBU_BOTTOM)
|
||||
wxEND_FLAGS( wxBitmapButtonStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton,"wx/bmpbuttn.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxBitmapButton)
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxBitmapButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxBitmapButton)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxBitmapButton , wxWindow* , Parent , wxWindowID , Id , wxBitmap , Bitmap , wxPoint , Position , wxSize , Size )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
||||
#endif
|
||||
|
||||
#define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
|
||||
|
||||
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& wxVALIDATOR_PARAM(validator),
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#define FOCUS_MARGIN 3
|
||||
|
||||
bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxBitmapButton::DrawFace( WXHDC dc, int left, int top,
|
||||
int right, int bottom, bool sel )
|
||||
{
|
||||
}
|
||||
|
||||
void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right,
|
||||
int bottom, bool WXUNUSED(sel) )
|
||||
{
|
||||
}
|
||||
|
||||
void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right,
|
||||
int bottom, bool with_marg )
|
||||
{
|
||||
}
|
||||
|
||||
void wxBitmapButton::SetDefault()
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxBitmapButton::DoGetBestSize() const
|
||||
{
|
||||
wxSize best;
|
||||
best.x = 0;
|
||||
best.y = 0;
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
#endif // wxUSE_BMPBUTTON
|
||||
|
||||
136
src/palmos/brush.cpp
Normal file
136
src/palmos/brush.cpp
Normal file
@@ -0,0 +1,136 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/brush.cpp
|
||||
// Purpose: wxBrush
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "brush.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/brush.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// wxBrush implementation
|
||||
// ============================================================================
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBrush ctors/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBrush::wxBrush()
|
||||
{
|
||||
}
|
||||
|
||||
wxBrush::wxBrush(const wxColour& col, int style)
|
||||
{
|
||||
}
|
||||
|
||||
wxBrush::wxBrush(const wxBitmap& stipple)
|
||||
{
|
||||
}
|
||||
|
||||
wxBrush::~wxBrush()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBrush house keeping stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBrush& wxBrush::operator=(const wxBrush& brush)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool wxBrush::operator==(const wxBrush& brush) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxBrush::CreateRefData() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBrush accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxColour wxBrush::GetColour() const
|
||||
{
|
||||
return wxNullColour;
|
||||
}
|
||||
|
||||
int wxBrush::GetStyle() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxBitmap *wxBrush::GetStipple() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WXHANDLE wxBrush::GetResourceHandle() const
|
||||
{
|
||||
return (WXHANDLE)0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBrush setters
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxBrush::SetColour(const wxColour& col)
|
||||
{
|
||||
}
|
||||
|
||||
void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
}
|
||||
|
||||
void wxBrush::SetStyle(int style)
|
||||
{
|
||||
}
|
||||
|
||||
void wxBrush::SetStipple(const wxBitmap& stipple)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
248
src/palmos/button.cpp
Normal file
248
src/palmos/button.cpp
Normal file
@@ -0,0 +1,248 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/button.cpp
|
||||
// Purpose: wxButton
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "button.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/button.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
WX_DEFINE_FLAGS( wxButtonStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxButtonStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxBU_LEFT)
|
||||
wxFLAGS_MEMBER(wxBU_RIGHT)
|
||||
wxFLAGS_MEMBER(wxBU_TOP)
|
||||
wxFLAGS_MEMBER(wxBU_BOTTOM)
|
||||
wxFLAGS_MEMBER(wxBU_EXACTFIT)
|
||||
wxEND_FLAGS( wxButtonStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxButton, wxControl,"wx/button.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxButton)
|
||||
wxEVENT_PROPERTY( Click , wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEvent)
|
||||
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Label, wxString , SetLabel, GetLabel, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxButton)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
|
||||
#endif
|
||||
|
||||
// this macro tries to adjust the default button height to a reasonable value
|
||||
// using the char height as the base
|
||||
#define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// creation/destruction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxButton::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxButton::~wxButton()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// flags
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// size management including autosizing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxButton::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxSize wxButtonBase::GetDefaultSize()
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxButton::SetDefault()
|
||||
{
|
||||
}
|
||||
|
||||
void wxButton::SetTmpDefault()
|
||||
{
|
||||
}
|
||||
|
||||
void wxButton::UnsetTmpDefault()
|
||||
{
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
wxButton::SetDefaultStyle(wxButton *btn, bool on)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxButton::SendClickEvent()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxButton::Command(wxCommandEvent & event)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event/message handlers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// owner-drawn buttons support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
// drawing helpers
|
||||
|
||||
static void DrawButtonText(HDC hdc,
|
||||
RECT *pRect,
|
||||
const wxString& text,
|
||||
COLORREF col)
|
||||
{
|
||||
}
|
||||
|
||||
static void DrawRect(HDC hdc, const RECT& r)
|
||||
{
|
||||
}
|
||||
|
||||
void wxButton::MakeOwnerDrawn()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxButton::SetBackgroundColour(const wxColour &colour)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxButton::SetForegroundColour(const wxColour &colour)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static void DrawButtonFrame(HDC hdc, const RECT& rectBtn,
|
||||
bool selected, bool pushed)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // __WIN32__
|
||||
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
115
src/palmos/caret.cpp
Normal file
115
src/palmos/caret.cpp
Normal file
@@ -0,0 +1,115 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/caret.cpp
|
||||
// Purpose: Palm OS implementation of wxCaret
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "caret.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/log.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/caret.h"
|
||||
|
||||
#if wxUSE_CARET
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#define CALL_CARET_API(api, args) \
|
||||
if ( !api args ) \
|
||||
wxLogLastError(_T(#api))
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// blink time
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
//static
|
||||
int wxCaretBase::GetBlinkTime()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//static
|
||||
void wxCaretBase::SetBlinkTime(int milliseconds)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// creating/destroying the caret
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxCaret::PalmOSCreateCaret()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCaret::OnSetFocus()
|
||||
{
|
||||
}
|
||||
|
||||
void wxCaret::OnKillFocus()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// showing/hiding the caret
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxCaret::DoShow()
|
||||
{
|
||||
}
|
||||
|
||||
void wxCaret::DoHide()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// moving the caret
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxCaret::DoMove()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// resizing the caret
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxCaret::DoSize()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
166
src/palmos/checkbox.cpp
Normal file
166
src/palmos/checkbox.cpp
Normal file
@@ -0,0 +1,166 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/checkbox.cpp
|
||||
// Purpose: wxCheckBox
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "checkbox.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#ifndef BST_UNCHECKED
|
||||
#define BST_UNCHECKED 0x0000
|
||||
#endif
|
||||
|
||||
#ifndef BST_CHECKED
|
||||
#define BST_CHECKED 0x0001
|
||||
#endif
|
||||
|
||||
#ifndef BST_INDETERMINATE
|
||||
#define BST_INDETERMINATE 0x0002
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxCheckBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxCheckBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxNO_BORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxEND_FLAGS( wxCheckBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckBox, wxControl,"wx/checkbox.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxCheckBox)
|
||||
wxEVENT_PROPERTY( Click , wxEVT_COMMAND_CHECKBOX_CLICKED , wxCommandEvent )
|
||||
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxCheckBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxCheckBox)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxCheckBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCheckBox::SetLabel(const wxString& label)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxCheckBox::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxCheckBox::SetValue(bool val)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxCheckBox::GetValue() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCheckBox::Command(wxCommandEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
wxCOMPILE_TIME_ASSERT(wxCHK_UNCHECKED == BST_UNCHECKED
|
||||
&& wxCHK_CHECKED == BST_CHECKED
|
||||
&& wxCHK_UNDETERMINED == BST_INDETERMINATE, EnumValuesIncorrect);
|
||||
|
||||
void wxCheckBox::DoSet3StateValue(wxCheckBoxState state)
|
||||
{
|
||||
}
|
||||
|
||||
wxCheckBoxState wxCheckBox::DoGet3StateValue() const
|
||||
{
|
||||
return (wxCheckBoxState) 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_CHECKBOX
|
||||
291
src/palmos/checklst.cpp
Normal file
291
src/palmos/checklst.cpp
Normal file
@@ -0,0 +1,291 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/checklst.cpp
|
||||
// Purpose: implementation of wxCheckListBox class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "checklst.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/object.h"
|
||||
#include "wx/colour.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/dcmemory.h"
|
||||
|
||||
#include "wx/settings.h"
|
||||
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/ownerdrw.h"
|
||||
#include "wx/checklst.h"
|
||||
|
||||
#include "wx/palmos/wrapwin.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// get item (converted to right type)
|
||||
#define GetItem(n) ((wxCheckListBoxItem *)(GetItem(n)))
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxCheckListBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxCheckListBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxLB_SINGLE)
|
||||
wxFLAGS_MEMBER(wxLB_MULTIPLE)
|
||||
wxFLAGS_MEMBER(wxLB_EXTENDED)
|
||||
wxFLAGS_MEMBER(wxLB_HSCROLL)
|
||||
wxFLAGS_MEMBER(wxLB_ALWAYS_SB)
|
||||
wxFLAGS_MEMBER(wxLB_NEEDED_SB)
|
||||
wxFLAGS_MEMBER(wxLB_SORT)
|
||||
wxFLAGS_MEMBER(wxLB_OWNERDRAW)
|
||||
|
||||
wxEND_FLAGS( wxCheckListBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox,"wx/checklst.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxCheckListBox)
|
||||
wxEVENT_PROPERTY( Toggle , wxEVT_COMMAND_CHECKLISTBOX_TOGGLED , wxCommandEvent )
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxCheckListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , wxLB_OWNERDRAW /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxCheckListBox)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_4( wxCheckListBox , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// declaration and implementation of wxCheckListBoxItem class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxCheckListBoxItem : public wxOwnerDrawn
|
||||
{
|
||||
friend class WXDLLEXPORT wxCheckListBox;
|
||||
public:
|
||||
// ctor
|
||||
wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex);
|
||||
|
||||
// drawing functions
|
||||
virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
|
||||
|
||||
// simple accessors and operations
|
||||
bool IsChecked() const { return m_bChecked; }
|
||||
|
||||
void Check(bool bCheck);
|
||||
void Toggle() { Check(!IsChecked()); }
|
||||
|
||||
void SendEvent();
|
||||
|
||||
private:
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxCheckListBoxItem)
|
||||
bool m_bChecked;
|
||||
wxCheckListBox *m_pParent;
|
||||
size_t m_nIndex;
|
||||
};
|
||||
|
||||
wxCheckListBoxItem::wxCheckListBoxItem(wxCheckListBox *pParent, size_t nIndex)
|
||||
: wxOwnerDrawn(wxEmptyString, TRUE) // checkable
|
||||
{
|
||||
}
|
||||
|
||||
bool wxCheckListBoxItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
wxODAction act, wxODStatus stat)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// change the state of the item and redraw it
|
||||
void wxCheckListBoxItem::Check(bool check)
|
||||
{
|
||||
}
|
||||
|
||||
// send an "item checked" event
|
||||
void wxCheckListBoxItem::SendEvent()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// implementation of wxCheckListBox class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// define event table
|
||||
// ------------------
|
||||
BEGIN_EVENT_TABLE(wxCheckListBox, wxListBox)
|
||||
EVT_KEY_DOWN(wxCheckListBox::OnKeyDown)
|
||||
EVT_LEFT_DOWN(wxCheckListBox::OnLeftClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// control creation
|
||||
// ----------------
|
||||
|
||||
// def ctor: use Create() to really create the control
|
||||
wxCheckListBox::wxCheckListBox()
|
||||
{
|
||||
}
|
||||
|
||||
// ctor which creates the associated control
|
||||
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
int nStrings, const wxString choices[],
|
||||
long style, const wxValidator& val,
|
||||
const wxString& name)
|
||||
{
|
||||
Create(parent, id, pos, size, nStrings, choices, style, val, name);
|
||||
}
|
||||
|
||||
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style, const wxValidator& val,
|
||||
const wxString& name)
|
||||
{
|
||||
Create(parent, id, pos, size, choices, style, val, name);
|
||||
}
|
||||
|
||||
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator, const wxString& name)
|
||||
{
|
||||
return wxListBox::Create(parent, id, pos, size, n, choices,
|
||||
style | wxLB_OWNERDRAW, validator, name);
|
||||
}
|
||||
|
||||
bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator, const wxString& name)
|
||||
{
|
||||
return wxListBox::Create(parent, id, pos, size, choices,
|
||||
style | wxLB_OWNERDRAW, validator, name);
|
||||
}
|
||||
|
||||
// misc overloaded methods
|
||||
// -----------------------
|
||||
|
||||
void wxCheckListBox::Delete(int N)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxCheckListBox::SetFont( const wxFont &font )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// create/retrieve item
|
||||
// --------------------
|
||||
|
||||
// create a check list box item
|
||||
wxOwnerDrawn *wxCheckListBox::CreateLboxItem(size_t nIndex)
|
||||
{
|
||||
wxCheckListBoxItem *pItem = new wxCheckListBoxItem(this, nIndex);
|
||||
return pItem;
|
||||
}
|
||||
|
||||
// return item size
|
||||
// ----------------
|
||||
bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check items
|
||||
// -----------
|
||||
|
||||
bool wxCheckListBox::IsChecked(size_t uiIndex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxCheckListBox::Check(size_t uiIndex, bool bCheck)
|
||||
{
|
||||
}
|
||||
|
||||
// process events
|
||||
// --------------
|
||||
|
||||
void wxCheckListBox::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxCheckListBox::OnLeftClick(wxMouseEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
int wxCheckListBox::DoHitTestItem(wxCoord x, wxCoord y) const
|
||||
{
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
284
src/palmos/choice.cpp
Normal file
284
src/palmos/choice.cpp
Normal file
@@ -0,0 +1,284 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choice.cpp
|
||||
// Purpose: wxChoice
|
||||
// Author: William Osborne
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "choice.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_CHOICE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/choice.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxChoiceStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxChoiceStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxEND_FLAGS( wxChoiceStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl,"wx/choice.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxChoice)
|
||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_CHOICE_SELECTED , wxCommandEvent )
|
||||
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxChoiceStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxChoice)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_4( wxChoice , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxChoice::CreateAndInit(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxChoice::MSWShouldPreProcessMessage(WXMSG *pMsg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxChoice::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// adding/deleting items to/from the list
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::DoAppend(const wxString& item)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxChoice::DoInsert(const wxString& item, int pos)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
{
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
void wxChoice::Free()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::GetSelection() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::GetCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
{
|
||||
}
|
||||
|
||||
wxString wxChoice::GetString(int n) const
|
||||
{
|
||||
wxString str;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
{
|
||||
}
|
||||
|
||||
void* wxChoice::DoGetItemClientData( int n ) const
|
||||
{
|
||||
return (void *)NULL;
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMSW specific helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxChoice::UpdateVisibleHeight()
|
||||
{
|
||||
}
|
||||
|
||||
void wxChoice::DoMoveWindow(int x, int y, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
void wxChoice::DoGetSize(int *w, int *h) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxChoice::DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxChoice::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
WXLRESULT wxChoice::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHBRUSH wxChoice::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
|
||||
WXUINT WXUNUSED(message),
|
||||
WXWPARAM WXUNUSED(wParam),
|
||||
WXLPARAM WXUNUSED(lParam)
|
||||
)
|
||||
{
|
||||
return (WXHBRUSH) 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_CHOICE
|
||||
210
src/palmos/clipbrd.cpp
Normal file
210
src/palmos/clipbrd.cpp
Normal file
@@ -0,0 +1,210 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: clipbrd.cpp
|
||||
// Purpose: Clipboard functionality
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "clipbrd.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/setup.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/object.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_METAFILE
|
||||
#include "wx/metafile.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
#include "wx/palmos/dib.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_DATAOBJ
|
||||
#include "wx/dataobj.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_OLE && !defined(__WXWINCE__)
|
||||
// use OLE clipboard
|
||||
#define wxUSE_OLE_CLIPBOARD 1
|
||||
#else // !wxUSE_DATAOBJ
|
||||
// use Win clipboard API
|
||||
#define wxUSE_OLE_CLIPBOARD 0
|
||||
#endif
|
||||
|
||||
#if wxUSE_OLE_CLIPBOARD
|
||||
#include <ole2.h>
|
||||
#endif // wxUSE_OLE_CLIPBOARD
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// old-style clipboard functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static bool gs_wxClipboardIsOpen = FALSE;
|
||||
|
||||
bool wxOpenClipboard()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxCloseClipboard()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxEmptyClipboard()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxIsClipboardOpened()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool wxSetClipboardData(wxDataFormat dataFormat,
|
||||
const void *data,
|
||||
int width, int height)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
||||
{
|
||||
void *retval = NULL;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat)
|
||||
{
|
||||
return (wxDataFormat::NativeFormat)::EnumClipboardFormats(dataFormat);
|
||||
}
|
||||
|
||||
int wxRegisterClipboardFormat(wxChar *formatName)
|
||||
{
|
||||
return ::RegisterClipboardFormat(formatName);
|
||||
}
|
||||
|
||||
bool wxGetClipboardFormatName(wxDataFormat dataFormat,
|
||||
wxChar *formatName,
|
||||
int maxCount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxClipboard
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
|
||||
|
||||
wxClipboard::wxClipboard()
|
||||
{
|
||||
m_clearOnExit = FALSE;
|
||||
m_isOpened = FALSE;
|
||||
}
|
||||
|
||||
wxClipboard::~wxClipboard()
|
||||
{
|
||||
if ( m_clearOnExit )
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
}
|
||||
|
||||
void wxClipboard::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxClipboard::Flush()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxClipboard::Open()
|
||||
{
|
||||
return wxOpenClipboard();
|
||||
}
|
||||
|
||||
bool wxClipboard::IsOpened() const
|
||||
{
|
||||
return wxIsClipboardOpened();
|
||||
}
|
||||
|
||||
bool wxClipboard::SetData( wxDataObject *data )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxClipboard::AddData( wxDataObject *data )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxClipboard::Close()
|
||||
{
|
||||
wxCloseClipboard();
|
||||
}
|
||||
|
||||
bool wxClipboard::IsSupported( wxDataFormat format )
|
||||
{
|
||||
return wxIsClipboardFormatAvailable(format);
|
||||
}
|
||||
|
||||
bool wxClipboard::GetData( wxDataObject& data )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
147
src/palmos/colordlg.cpp
Normal file
147
src/palmos/colordlg.cpp
Normal file
@@ -0,0 +1,147 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/colordlg.cpp
|
||||
// Purpose: wxColourDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "colordlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/defs.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/colour.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_COLOURDLG && !defined(__SMARTPHONE__)
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/colordlg.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxColourDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxColourDialog::wxColourDialog()
|
||||
{
|
||||
}
|
||||
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxColourDialog::ShowModal()
|
||||
{
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// title
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxColourDialog::SetTitle(const wxString& title)
|
||||
{
|
||||
m_title = title;
|
||||
}
|
||||
|
||||
wxString wxColourDialog::GetTitle() const
|
||||
{
|
||||
return m_title;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// position/size
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxColourDialog::DoGetPosition(int *x, int *y) const
|
||||
{
|
||||
if ( x )
|
||||
*x = m_pos.x;
|
||||
if ( y )
|
||||
*y = m_pos.y;
|
||||
}
|
||||
|
||||
void wxColourDialog::DoSetSize(int x, int y,
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags))
|
||||
{
|
||||
if ( x != -1 )
|
||||
m_pos.x = x;
|
||||
|
||||
if ( y != -1 )
|
||||
m_pos.y = y;
|
||||
|
||||
// ignore the size params - we can't change the size of a standard dialog
|
||||
return;
|
||||
}
|
||||
|
||||
// NB: of course, both of these functions are completely bogus, but it's better
|
||||
// than nothing
|
||||
void wxColourDialog::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
// the standard dialog size
|
||||
if ( width )
|
||||
*width = 225;
|
||||
if ( height )
|
||||
*height = 324;
|
||||
}
|
||||
|
||||
void wxColourDialog::DoGetClientSize(int *width, int *height) const
|
||||
{
|
||||
// the standard dialog size
|
||||
if ( width )
|
||||
*width = 219;
|
||||
if ( height )
|
||||
*height = 299;
|
||||
}
|
||||
|
||||
#endif
|
||||
114
src/palmos/colour.cpp
Normal file
114
src/palmos/colour.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colour.cpp
|
||||
// Purpose: wxColour class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "colour.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/colour.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
template<> void wxStringReadValue(const wxString &s , wxColour &data )
|
||||
{
|
||||
// copied from VS xrc
|
||||
unsigned long tmp = 0;
|
||||
|
||||
if (s.Length() != 7 || s[0u] != wxT('#')
|
||||
|| wxSscanf(s.c_str(), wxT("#%lX"), &tmp) != 1)
|
||||
{
|
||||
wxLogError(_("String To Colour : Incorrect colour specification : %s"),
|
||||
s.c_str() );
|
||||
data = wxNullColour;
|
||||
}
|
||||
else
|
||||
{
|
||||
data = wxColour((unsigned char) ((tmp & 0xFF0000) >> 16) ,
|
||||
(unsigned char) ((tmp & 0x00FF00) >> 8),
|
||||
(unsigned char) ((tmp & 0x0000FF)));
|
||||
}
|
||||
}
|
||||
|
||||
template<> void wxStringWriteValue(wxString &s , const wxColour &data )
|
||||
{
|
||||
s = wxString::Format(wxT("#%02X%02X%02X"),
|
||||
data.Red(), data.Green(), data.Blue() );
|
||||
}
|
||||
|
||||
wxTO_STRING_IMP( wxColour )
|
||||
wxFROM_STRING_IMP( wxColour )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( wxColour , wxObject , "wx/colour.h" , &wxTO_STRING( wxColour ) , &wxFROM_STRING( wxColour ))
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxColour)
|
||||
wxREADONLY_PROPERTY( Red, unsigned char, Red, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
|
||||
wxREADONLY_PROPERTY( Green, unsigned char, Green, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
|
||||
wxREADONLY_PROPERTY( Blue, unsigned char, Blue, EMPTY_MACROVALUE , 0 /*flags*/, wxT("Helpstring"), wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_3( wxColour, unsigned char, Red, unsigned char, Green, unsigned char, Blue )
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxColour)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
||||
#endif
|
||||
|
||||
// Colour
|
||||
|
||||
void wxColour::Init()
|
||||
{
|
||||
m_isInit = false;
|
||||
m_pixel = 0;
|
||||
m_red =
|
||||
m_blue =
|
||||
m_green = 0;
|
||||
}
|
||||
|
||||
wxColour::wxColour(const wxColour& col)
|
||||
{
|
||||
*this = col;
|
||||
}
|
||||
|
||||
wxColour& wxColour::operator=(const wxColour& col)
|
||||
{
|
||||
m_red = col.m_red;
|
||||
m_green = col.m_green;
|
||||
m_blue = col.m_blue;
|
||||
m_isInit = col.m_isInit;
|
||||
m_pixel = col.m_pixel;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxColour::InitFromName(const wxString& name)
|
||||
{
|
||||
// leave invalid
|
||||
Init();
|
||||
}
|
||||
|
||||
wxColour::~wxColour()
|
||||
{
|
||||
}
|
||||
|
||||
void wxColour::Set(unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
}
|
||||
|
||||
265
src/palmos/combobox.cpp
Normal file
265
src/palmos/combobox.cpp
Normal file
@@ -0,0 +1,265 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/combobox.cpp
|
||||
// Purpose: wxComboBox class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "combobox.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
// for wxEVT_COMMAND_TEXT_ENTER
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/combobox.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/clipbrd.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
|
||||
#include <commctrl.h>
|
||||
#endif
|
||||
#include "wx/tooltip.h"
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxComboBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxComboBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxCB_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxCB_SORT)
|
||||
wxFLAGS_MEMBER(wxCB_READONLY)
|
||||
wxFLAGS_MEMBER(wxCB_DROPDOWN)
|
||||
|
||||
wxEND_FLAGS( wxComboBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxComboBox)
|
||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent )
|
||||
wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
|
||||
|
||||
// TODO DELEGATES
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Value ,wxString, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxComboBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxComboBox)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxComboBox , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// function prototypes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global vars
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// the pointer to standard radio button wnd proc
|
||||
static WNDPROC gs_wndprocEdit = (WNDPROC)NULL;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC,
|
||||
WXHWND WXUNUSED(pWnd),
|
||||
WXUINT WXUNUSED(nCtlColor),
|
||||
WXUINT WXUNUSED(message),
|
||||
WXWPARAM WXUNUSED(wParam),
|
||||
WXLPARAM WXUNUSED(lParam))
|
||||
{
|
||||
HDC hdc = (HDC)pDC;
|
||||
wxColour colBack = GetBackgroundColour();
|
||||
|
||||
if (!IsEnabled())
|
||||
colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
||||
|
||||
::SetBkColor(hdc, wxColourToRGB(colBack));
|
||||
::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
|
||||
|
||||
wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID);
|
||||
|
||||
return (WXHBRUSH)brush->GetResourceHandle();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxComboBox callbacks
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxComboBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHWND wxComboBox::GetEditHWND() const
|
||||
{
|
||||
return (WXHWND)0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxComboBox creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxComboBox::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxComboBox text control-like methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxComboBox::SetValue(const wxString& value)
|
||||
{
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
void wxComboBox::Copy()
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::Cut()
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::Paste()
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::SetEditable(bool WXUNUSED(editable))
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::SetInsertionPoint(long pos)
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::SetInsertionPointEnd()
|
||||
{
|
||||
}
|
||||
|
||||
long wxComboBox::GetInsertionPoint() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxComboBox::GetLastPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::Remove(long from, long to)
|
||||
{
|
||||
}
|
||||
|
||||
void wxComboBox::SetSelection(long from, long to)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
201
src/palmos/control.cpp
Normal file
201
src/palmos/control.cpp
Normal file
@@ -0,0 +1,201 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/control.cpp
|
||||
// Purpose: wxControl class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "control.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_CONTROLS
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxControl, wxWindow)
|
||||
EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ============================================================================
|
||||
// wxControl implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControl ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxControl::~wxControl()
|
||||
{
|
||||
m_isBeingDeleted = TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// control window creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxControl::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& wxVALIDATOR_PARAM(validator),
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
|
||||
return FALSE;
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
SetValidator(validator);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxControl::MSWCreateControl(const wxChar *classname,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size)
|
||||
{
|
||||
WXDWORD exstyle;
|
||||
WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), &exstyle);
|
||||
|
||||
return MSWCreateControl(classname, msStyle, pos, size, label, exstyle);
|
||||
}
|
||||
|
||||
bool wxControl::MSWCreateControl(const wxChar *classname,
|
||||
WXDWORD style,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxString& label,
|
||||
WXDWORD exstyle)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// various accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxBorder wxControl::GetDefaultBorder() const
|
||||
{
|
||||
// we want to automatically give controls a sunken style (confusingly,
|
||||
// it may not really mean sunken at all as we map it to WS_EX_CLIENTEDGE
|
||||
// which is not sunken at all under Windows XP -- rather, just the default)
|
||||
return wxBORDER_SUNKEN;
|
||||
}
|
||||
|
||||
WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxSize wxControl::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(16, 16);
|
||||
}
|
||||
|
||||
/* static */ wxVisualAttributes
|
||||
wxControl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
{
|
||||
wxVisualAttributes attrs;
|
||||
|
||||
// old school (i.e. not "common") controls use the standard dialog font
|
||||
// by default
|
||||
attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
|
||||
// most, or at least many, of the controls use the same colours as the
|
||||
// buttons -- others will have to override this (and possibly simply call
|
||||
// GetCompositeControlsDefaultAttributes() from their versions)
|
||||
attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT);
|
||||
attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE);
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// another version for the "composite", i.e. non simple controls
|
||||
/* static */ wxVisualAttributes
|
||||
wxControl::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(variant))
|
||||
{
|
||||
wxVisualAttributes attrs;
|
||||
attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
|
||||
attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
|
||||
attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// message handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxControl::ProcessCommand(wxCommandEvent& event)
|
||||
{
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
#ifdef __WIN95__
|
||||
bool wxControl::MSWOnNotify(int idCtrl,
|
||||
WXLPARAM lParam,
|
||||
WXLPARAM* result)
|
||||
{
|
||||
}
|
||||
#endif // Win95
|
||||
|
||||
void wxControl::OnEraseBackground(wxEraseEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
WXHBRUSH wxControl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
|
||||
#if wxUSE_CTL3D
|
||||
WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam
|
||||
#else
|
||||
WXUINT WXUNUSED(message),
|
||||
WXWPARAM WXUNUSED(wParam),
|
||||
WXLPARAM WXUNUSED(lParam)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return (WXHBRUSH)0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#endif // wxUSE_CONTROLS
|
||||
537
src/palmos/crashrpt.cpp
Normal file
537
src/palmos/crashrpt.cpp
Normal file
@@ -0,0 +1,537 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/crashrpt.cpp
|
||||
// Purpose: helpers for structured exception handling (SEH)
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
The code generating the crash reports in this file is heavily based on
|
||||
Matt Pietrek's column from the March 2002 issue of MSDN Magazine. Note
|
||||
that this code is not currently used by default, however. In any case,
|
||||
all bugs are my alone.
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_ON_FATAL_EXCEPTION
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
/*
|
||||
We have two possibilities here: one, a priori more interesting, is to
|
||||
generate the crash report ourselves and include the values of all the
|
||||
variables in the dump. Unfortunately my code to do it doesn't work in
|
||||
"real life" situations i.e. it works in small examples but invariably
|
||||
gets confused by something in big programs which makes quite useless.
|
||||
|
||||
The other possibility is to let dbghelp.dll to do the work for us and
|
||||
analyze its results later using a debugger with knowledge about crash
|
||||
dumps, such as (free!) WinDbg. This also has another advantage of not
|
||||
needing to ship the .pdb file (containing debug info) to the user. So
|
||||
this is the default now, but I keep the old code just in case, and if
|
||||
you really want you can still use it.
|
||||
*/
|
||||
#define wxUSE_MINIDUMP 1
|
||||
|
||||
#if !wxUSE_MINIDUMP
|
||||
#include "wx/longlong.h"
|
||||
#endif // wxUSE_MINIDUMP
|
||||
|
||||
#include "wx/datetime.h"
|
||||
|
||||
#include "wx/dynload.h"
|
||||
|
||||
#include "wx/palmos/crashrpt.h"
|
||||
|
||||
#include "wx/palmos/wrapwin.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#ifndef wxUSE_DBGHELP
|
||||
#define wxUSE_DBGHELP 0
|
||||
#endif
|
||||
|
||||
#if wxUSE_DBGHELP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types of imagehlp.h functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_MINIDUMP
|
||||
|
||||
typedef BOOL (WINAPI *MiniDumpWriteDump_t)(HANDLE, DWORD, HANDLE,
|
||||
MINIDUMP_TYPE,
|
||||
CONST PMINIDUMP_EXCEPTION_INFORMATION,
|
||||
CONST PMINIDUMP_USER_STREAM_INFORMATION,
|
||||
CONST PMINIDUMP_CALLBACK_INFORMATION);
|
||||
#else // !wxUSE_MINIDUMP
|
||||
typedef DWORD (WINAPI *SymSetOptions_t)(DWORD);
|
||||
typedef BOOL (WINAPI *SymInitialize_t)(HANDLE, LPSTR, BOOL);
|
||||
typedef BOOL (WINAPI *StackWalk_t)(DWORD, HANDLE, HANDLE, LPSTACKFRAME,
|
||||
LPVOID, PREAD_PROCESS_MEMORY_ROUTINE,
|
||||
PFUNCTION_TABLE_ACCESS_ROUTINE,
|
||||
PGET_MODULE_BASE_ROUTINE,
|
||||
PTRANSLATE_ADDRESS_ROUTINE);
|
||||
typedef BOOL (WINAPI *SymFromAddr_t)(HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO);
|
||||
typedef LPVOID (WINAPI *SymFunctionTableAccess_t)(HANDLE, DWORD);
|
||||
typedef DWORD (WINAPI *SymGetModuleBase_t)(HANDLE, DWORD);
|
||||
typedef BOOL (WINAPI *SymGetLineFromAddr_t)(HANDLE, DWORD,
|
||||
PDWORD, PIMAGEHLP_LINE);
|
||||
typedef BOOL (WINAPI *SymSetContext_t)(HANDLE, PIMAGEHLP_STACK_FRAME,
|
||||
PIMAGEHLP_CONTEXT);
|
||||
typedef BOOL (WINAPI *SymEnumSymbols_t)(HANDLE, ULONG64, PCSTR,
|
||||
PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID);
|
||||
typedef BOOL (WINAPI *SymGetTypeInfo_t)(HANDLE, DWORD64, ULONG,
|
||||
IMAGEHLP_SYMBOL_TYPE_INFO, PVOID);
|
||||
#endif // wxUSE_MINIDUMP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_MINIDUMP
|
||||
|
||||
// Stolen from CVCONST.H in the DIA 2.0 SDK
|
||||
enum BasicType
|
||||
{
|
||||
BASICTYPE_NOTYPE = 0,
|
||||
BASICTYPE_VOID = 1,
|
||||
BASICTYPE_CHAR = 2,
|
||||
BASICTYPE_WCHAR = 3,
|
||||
BASICTYPE_INT = 6,
|
||||
BASICTYPE_UINT = 7,
|
||||
BASICTYPE_FLOAT = 8,
|
||||
BASICTYPE_BCD = 9,
|
||||
BASICTYPE_BOOL = 10,
|
||||
BASICTYPE_LONG = 13,
|
||||
BASICTYPE_ULONG = 14,
|
||||
BASICTYPE_CURRENCY = 25,
|
||||
BASICTYPE_DATE = 26,
|
||||
BASICTYPE_VARIANT = 27,
|
||||
BASICTYPE_COMPLEX = 28,
|
||||
BASICTYPE_BIT = 29,
|
||||
BASICTYPE_BSTR = 30,
|
||||
BASICTYPE_HRESULT = 31
|
||||
};
|
||||
|
||||
// Same as above
|
||||
enum SymbolTag
|
||||
{
|
||||
SYMBOL_TAG_NULL,
|
||||
SYMBOL_TAG_FUNCTION = 5,
|
||||
SYMBOL_TAG_DATA = 7,
|
||||
SYMBOL_TAG_PUBLIC = 10, // appears in .DBGs
|
||||
SYMBOL_TAG_UDT,
|
||||
SYMBOL_TAG_ENUM,
|
||||
SYMBOL_TAG_FUNCTION_TYPE,
|
||||
SYMBOL_TAG_POINTER_TYPE,
|
||||
SYMBOL_TAG_ARRAY_TYPE,
|
||||
SYMBOL_TAG_BASE_TYPE,
|
||||
SYMBOL_TAG_TYPEDEF,
|
||||
SYMBOL_TAG_BASECLASS
|
||||
};
|
||||
|
||||
#endif // wxUSE_MINIDUMP
|
||||
|
||||
#endif // wxUSE_DBGHELP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// low level wxBusyCursor replacement: we use Win32 API directly here instead
|
||||
// of going through wxWidgets calls as this could be dangerous
|
||||
class BusyCursor
|
||||
{
|
||||
public:
|
||||
BusyCursor()
|
||||
{
|
||||
}
|
||||
|
||||
~BusyCursor()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
// the real crash report generator
|
||||
class wxCrashReportImpl
|
||||
{
|
||||
public:
|
||||
wxCrashReportImpl(const wxChar *filename);
|
||||
|
||||
bool Generate(int flags);
|
||||
|
||||
~wxCrashReportImpl()
|
||||
{
|
||||
if ( m_hFile != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
::CloseHandle(m_hFile);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// formatted output to m_hFile
|
||||
void Output(const wxChar *format, ...);
|
||||
|
||||
// output end of line
|
||||
void OutputEndl() { Output(_T("\r\n")); }
|
||||
|
||||
#if wxUSE_DBGHELP
|
||||
|
||||
#if !wxUSE_MINIDUMP
|
||||
// translate exception code to its symbolic name
|
||||
static wxString GetExceptionString(DWORD dwCode);
|
||||
|
||||
// return the type from "type index"
|
||||
static BasicType GetBasicType(DWORD64 modBase, DWORD typeIndex);
|
||||
|
||||
// return the name for the type index
|
||||
static wxString GetSymbolName(DWORD64 modBase, DWORD dwTypeIndex);
|
||||
|
||||
// return the string representation of the variable value
|
||||
static wxString FormatSimpleValue(BasicType bt,
|
||||
DWORD64 length,
|
||||
PVOID pAddress);
|
||||
|
||||
// return string representation of a struct field (which may itself be a
|
||||
// struct, of course)
|
||||
static wxString FormatField(DWORD64 modBase,
|
||||
DWORD dwTypeIndex,
|
||||
void *pVariable,
|
||||
unsigned level);
|
||||
|
||||
// show the name and value of the given symbol
|
||||
static wxString FormatSymbol(PSYMBOL_INFO pSym, STACKFRAME *sf);
|
||||
|
||||
// show value described by SYMBOL_INFO located at pVariable
|
||||
static wxString FormatAnyValue(PSYMBOL_INFO pSym, void *pVariable);
|
||||
|
||||
// show value of possibly complex (user-defined) type
|
||||
static wxString FormatUDT(DWORD64 modBase,
|
||||
DWORD dwTypeIndex,
|
||||
void *pVariable,
|
||||
unsigned level = 0);
|
||||
|
||||
// outputs information about the given symbol
|
||||
void OutputSymbol(PSYMBOL_INFO pSymInfo, STACKFRAME *sf);
|
||||
|
||||
// map address to module (and also section:offset), retunr true if ok
|
||||
static bool GetLogicalAddress(PVOID addr,
|
||||
PTSTR szModule,
|
||||
DWORD len,
|
||||
DWORD& section,
|
||||
DWORD& offset);
|
||||
|
||||
// callback used with SymEnumSymbols() to process all variables
|
||||
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO pSymInfo,
|
||||
ULONG SymbolSize,
|
||||
PVOID UserContext);
|
||||
|
||||
|
||||
// show the general information about exception which should be always
|
||||
// available
|
||||
//
|
||||
// returns the module of the handle where the crash occured
|
||||
HANDLE OutputBasicContext(EXCEPTION_RECORD *pExceptionRecord, CONTEXT *pCtx);
|
||||
|
||||
// output the call stack and local variables values
|
||||
void OutputStack(const CONTEXT *pCtx, int flags);
|
||||
|
||||
// output the global variables values
|
||||
void OutputGlobals(HANDLE hModuleCrash);
|
||||
|
||||
|
||||
// the current stack frame (may be NULL)
|
||||
STACKFRAME *m_sfCurrent;
|
||||
#endif // !wxUSE_MINIDUMP
|
||||
|
||||
// load all the functions we need from dbghelp.dll, return true if all ok
|
||||
bool BindDbgHelpFunctions(const wxDynamicLibrary& dllDbgHelp);
|
||||
|
||||
|
||||
// dynamically loaded dbghelp.dll functions
|
||||
#define DECLARE_SYM_FUNCTION(func) static func ## _t func
|
||||
|
||||
#if wxUSE_MINIDUMP
|
||||
DECLARE_SYM_FUNCTION(MiniDumpWriteDump);
|
||||
#else // !wxUSE_MINIDUMP
|
||||
DECLARE_SYM_FUNCTION(SymSetOptions);
|
||||
DECLARE_SYM_FUNCTION(SymInitialize);
|
||||
DECLARE_SYM_FUNCTION(StackWalk);
|
||||
DECLARE_SYM_FUNCTION(SymFromAddr);
|
||||
DECLARE_SYM_FUNCTION(SymFunctionTableAccess);
|
||||
DECLARE_SYM_FUNCTION(SymGetModuleBase);
|
||||
DECLARE_SYM_FUNCTION(SymGetLineFromAddr);
|
||||
DECLARE_SYM_FUNCTION(SymSetContext);
|
||||
DECLARE_SYM_FUNCTION(SymEnumSymbols);
|
||||
DECLARE_SYM_FUNCTION(SymGetTypeInfo);
|
||||
#endif // wxUSE_MINIDUMP/!wxUSE_MINIDUMP
|
||||
|
||||
#undef DECLARE_SYM_FUNCTION
|
||||
#endif // wxUSE_DBGHELP
|
||||
|
||||
// the handle of the report file
|
||||
HANDLE m_hFile;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// global pointer to exception information, only valid inside OnFatalException
|
||||
extern WXDLLIMPEXP_BASE EXCEPTION_POINTERS *wxGlobalSEInformation = NULL;
|
||||
|
||||
|
||||
// flag telling us whether the application wants to handle exceptions at all
|
||||
static bool gs_handleExceptions = false;
|
||||
|
||||
// the file name where the report about exception is written
|
||||
static wxChar gs_reportFilename[MAX_PATH];
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
#if wxUSE_DBGHELP
|
||||
|
||||
#define DEFINE_SYM_FUNCTION(func) func ## _t wxCrashReportImpl::func = 0
|
||||
|
||||
#if wxUSE_MINIDUMP
|
||||
DEFINE_SYM_FUNCTION(MiniDumpWriteDump);
|
||||
#else // !wxUSE_MINIDUMP
|
||||
DEFINE_SYM_FUNCTION(SymSetOptions);
|
||||
DEFINE_SYM_FUNCTION(SymInitialize);
|
||||
DEFINE_SYM_FUNCTION(StackWalk);
|
||||
DEFINE_SYM_FUNCTION(SymFromAddr);
|
||||
DEFINE_SYM_FUNCTION(SymFunctionTableAccess);
|
||||
DEFINE_SYM_FUNCTION(SymGetModuleBase);
|
||||
DEFINE_SYM_FUNCTION(SymGetLineFromAddr);
|
||||
DEFINE_SYM_FUNCTION(SymSetContext);
|
||||
DEFINE_SYM_FUNCTION(SymEnumSymbols);
|
||||
DEFINE_SYM_FUNCTION(SymGetTypeInfo);
|
||||
#endif // wxUSE_MINIDUMP/!wxUSE_MINIDUMP
|
||||
|
||||
#undef DEFINE_SYM_FUNCTION
|
||||
|
||||
#endif // wxUSE_DBGHELP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCrashReportImpl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCrashReportImpl::wxCrashReportImpl(const wxChar *filename)
|
||||
{
|
||||
}
|
||||
|
||||
void wxCrashReportImpl::Output(const wxChar *format, ...)
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_DBGHELP
|
||||
|
||||
#if !wxUSE_MINIDUMP
|
||||
|
||||
bool
|
||||
wxCrashReportImpl::GetLogicalAddress(PVOID addr,
|
||||
PTSTR szModule,
|
||||
DWORD len,
|
||||
DWORD& section,
|
||||
DWORD& offset)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */ BasicType
|
||||
wxCrashReportImpl::GetBasicType(DWORD64 modBase, DWORD typeIndex)
|
||||
{
|
||||
return BASICTYPE_NOTYPE;
|
||||
}
|
||||
|
||||
/* static */ wxString
|
||||
wxCrashReportImpl::FormatSimpleValue(BasicType bt,
|
||||
DWORD64 length,
|
||||
PVOID pAddress)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxString wxCrashReportImpl::GetSymbolName(DWORD64 modBase, DWORD dwTypeIndex)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// this is called for the struct members/base classes
|
||||
wxString
|
||||
wxCrashReportImpl::FormatField(DWORD64 modBase,
|
||||
DWORD dwTypeIndex,
|
||||
void *pVariable,
|
||||
unsigned level)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// If it's a user defined type (UDT), recurse through its members until we're
|
||||
// at fundamental types.
|
||||
wxString
|
||||
wxCrashReportImpl::FormatUDT(DWORD64 modBase,
|
||||
DWORD dwTypeIndex,
|
||||
void *pVariable,
|
||||
unsigned level)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// return the string containing the symbol of the given symbol
|
||||
/* static */ wxString
|
||||
wxCrashReportImpl::FormatAnyValue(PSYMBOL_INFO pSym, void *pVariable)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// display contents and type of the given variable
|
||||
/* static */ wxString
|
||||
wxCrashReportImpl::FormatSymbol(PSYMBOL_INFO pSym, STACKFRAME *sf)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void
|
||||
wxCrashReportImpl::OutputSymbol(PSYMBOL_INFO pSymInfo, STACKFRAME *sf)
|
||||
{
|
||||
}
|
||||
|
||||
// callback for SymEnumSymbols()
|
||||
/* static */
|
||||
BOOL CALLBACK
|
||||
wxCrashReportImpl::EnumerateSymbolsCallback(PSYMBOL_INFO pSymInfo,
|
||||
ULONG WXUNUSED(SymbolSize),
|
||||
PVOID UserContext)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
HANDLE
|
||||
wxCrashReportImpl::OutputBasicContext(EXCEPTION_RECORD *pExceptionRecord,
|
||||
CONTEXT *pCtx)
|
||||
{
|
||||
return ::GetModuleHandle(szFaultingModule);
|
||||
}
|
||||
|
||||
void wxCrashReportImpl::OutputStack(const CONTEXT *pCtx, int flags)
|
||||
{
|
||||
}
|
||||
|
||||
void wxCrashReportImpl::OutputGlobals(HANDLE hModule)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_MINIDUMP
|
||||
|
||||
bool wxCrashReportImpl::BindDbgHelpFunctions(const wxDynamicLibrary& dllDbgHelp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if !wxUSE_MINIDUMP
|
||||
|
||||
/* static */
|
||||
wxString wxCrashReportImpl::GetExceptionString(DWORD dwCode)
|
||||
{
|
||||
wxString s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
#endif // !wxUSE_MINIDUMP
|
||||
|
||||
#endif // wxUSE_DBGHELP
|
||||
|
||||
bool wxCrashReportImpl::Generate(
|
||||
#if wxUSE_DBGHELP
|
||||
int flags
|
||||
#else
|
||||
int WXUNUSED(flags)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCrashReport
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* static */
|
||||
void wxCrashReport::SetFileName(const wxChar *filename)
|
||||
{
|
||||
}
|
||||
|
||||
/* static */
|
||||
const wxChar *wxCrashReport::GetFileName()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool wxCrashReport::Generate(int flags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxApp::OnFatalException() support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxHandleFatalExceptions(bool doit)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
extern unsigned long wxGlobalSEHandler(EXCEPTION_POINTERS *pExcPtrs)
|
||||
{
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
#else // !wxUSE_ON_FATAL_EXCEPTION
|
||||
|
||||
bool wxHandleFatalExceptions(bool WXUNUSED(doit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_ON_FATAL_EXCEPTION/!wxUSE_ON_FATAL_EXCEPTION
|
||||
|
||||
138
src/palmos/cursor.cpp
Normal file
138
src/palmos/cursor.cpp
Normal file
@@ -0,0 +1,138 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/cursor.cpp
|
||||
// Purpose: wxCursor class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "cursor.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxGDIObject)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Current cursor, in order to hang on to cursor handle when setting the cursor
|
||||
// globally
|
||||
static wxCursor *gs_globalCursor = NULL;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Cursors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCursor::wxCursor()
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
wxCursor::wxCursor(const wxImage& image)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
wxCursor::wxCursor(const char WXUNUSED(bits)[],
|
||||
int WXUNUSED(width),
|
||||
int WXUNUSED(height),
|
||||
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
|
||||
const char WXUNUSED(maskBits)[])
|
||||
{
|
||||
}
|
||||
|
||||
wxCursor::wxCursor(const wxString& filename,
|
||||
long kind,
|
||||
int hotSpotX,
|
||||
int hotSpotY)
|
||||
{
|
||||
}
|
||||
|
||||
// Cursors by stock number
|
||||
wxCursor::wxCursor(int idCursor)
|
||||
{
|
||||
}
|
||||
|
||||
wxCursor::~wxCursor()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// other wxCursor functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxCursor::operator==(const wxCursor& cursor) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxGDIImageRefData *wxCursor::CreateData() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Global cursor setting
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const wxCursor *wxGetGlobalCursor()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxSetCursor(const wxCursor& cursor)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
22
src/palmos/data.cpp
Normal file
22
src/palmos/data.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: data.cpp
|
||||
// Purpose: Various data
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "data.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
510
src/palmos/dc.cpp
Normal file
510
src/palmos/dc.cpp
Normal file
@@ -0,0 +1,510 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.cpp
|
||||
// Purpose: wxDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dc.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/icon.h"
|
||||
#endif
|
||||
|
||||
#include "wx/sysopt.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/dynload.h"
|
||||
|
||||
#ifdef wxHAVE_RAW_BITMAP
|
||||
#include "wx/rawbmp.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifndef AC_SRC_ALPHA
|
||||
#define AC_SRC_ALPHA 1
|
||||
#endif
|
||||
|
||||
/* Quaternary raster codes */
|
||||
#ifndef MAKEROP4
|
||||
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
|
||||
#endif
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static const int VIEWPORT_EXTENT = 1000;
|
||||
|
||||
static const int MM_POINTS = 9;
|
||||
static const int MM_METRIC = 10;
|
||||
|
||||
// usually this is defined in math.h
|
||||
#ifndef M_PI
|
||||
static const double M_PI = 3.14159265358979323846;
|
||||
#endif // M_PI
|
||||
|
||||
#define DSTCOPY 0x00AA0029
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDC
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Default constructor
|
||||
wxDC::wxDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxDC::~wxDC()
|
||||
{
|
||||
}
|
||||
|
||||
// This will select current objects out of the DC,
|
||||
// which is what you have to do before deleting the
|
||||
// DC.
|
||||
void wxDC::SelectOldObjects(WXHDC dc)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// clipping
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxDC::UpdateClipBox()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
wxDC::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
|
||||
{
|
||||
}
|
||||
|
||||
// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion()
|
||||
void wxDC::SetClippingHrgn(WXHRGN hrgn)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// query capabilities
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxDC::CanDrawBitmap() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDC::CanGetTextExtent() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxDC::GetDepth() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// drawing
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxDC::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxDC::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxDC::DoCrossHair(wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||
{
|
||||
}
|
||||
|
||||
// Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
|
||||
// and ending at (x2, y2)
|
||||
void wxDC::DoDrawArc(wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawCheckMark(wxCoord x1, wxCoord y1,
|
||||
wxCoord width, wxCoord height)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
wxDC::DoDrawPolyPolygon(int n,
|
||||
int count[],
|
||||
wxPoint points[],
|
||||
wxCoord xoffset,
|
||||
wxCoord yoffset,
|
||||
int fillStyle)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRotatedText(const wxString& text,
|
||||
wxCoord x, wxCoord y,
|
||||
double angle)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// set GDI objects
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
|
||||
void wxDC::DoSelectPalette(bool realize)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetPalette(const wxPalette& palette)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::InitializePalette()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
void wxDC::SetFont(const wxFont& font)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetPen(const wxPen& pen)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetBrush(const wxBrush& brush)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetBackground(const wxBrush& brush)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetBackgroundMode(int mode)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalFunction(int function)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetRop(WXHDC dc)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxDC::StartDoc(const wxString& WXUNUSED(message))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDC::EndDoc()
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::StartPage()
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::EndPage()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// text metrics
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxCoord wxDC::GetCharHeight() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDC::GetCharWidth() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent, wxCoord *externalLeading,
|
||||
wxFont *font) const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void wxDC::SetMapMode(int mode)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetUserScale(double x, double y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetAxisOrientation(bool xLeftRight, bool yBottomUp)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetSystemScale(double x, double y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalOrigin(wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetDeviceOrigin(wxCoord x, wxCoord y)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// coordinates transformations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// bit blit
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop, bool useMask,
|
||||
wxCoord xsrcMask, wxCoord ysrcMask)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSize(int *w, int *h) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM(int *w, int *h) const
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxDC::GetPPI() const
|
||||
{
|
||||
return wxSize(0, 0);
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalScale(double x, double y)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DC caching
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DC_CACHEING
|
||||
|
||||
wxList wxDC::sm_bitmapCache;
|
||||
wxList wxDC::sm_dcCache;
|
||||
|
||||
wxDCCacheEntry::wxDCCacheEntry(WXHBITMAP hBitmap, int w, int h, int depth)
|
||||
{
|
||||
}
|
||||
|
||||
wxDCCacheEntry::wxDCCacheEntry(WXHDC hDC, int depth)
|
||||
{
|
||||
}
|
||||
|
||||
wxDCCacheEntry::~wxDCCacheEntry()
|
||||
{
|
||||
}
|
||||
|
||||
wxDCCacheEntry* wxDC::FindBitmapInCache(WXHDC dc, int w, int h)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxDCCacheEntry* wxDC::FindDCInCache(wxDCCacheEntry* notThis, WXHDC dc)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxDC::AddToBitmapCache(wxDCCacheEntry* entry)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::AddToDCCache(wxDCCacheEntry* entry)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::ClearCache()
|
||||
{
|
||||
}
|
||||
|
||||
class wxDCModule : public wxModule
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit() { return true; }
|
||||
virtual void OnExit() { wxDC::ClearCache(); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDCModule)
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDCModule, wxModule)
|
||||
|
||||
#endif // wxUSE_DC_CACHEING
|
||||
|
||||
163
src/palmos/dcclient.cpp
Normal file
163
src/palmos/dcclient.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcclient.cpp
|
||||
// Purpose: wxClientDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dcclient.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// array/list types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
struct WXDLLEXPORT wxPaintDCInfo
|
||||
{
|
||||
wxPaintDCInfo(wxWindow *win, wxDC *dc)
|
||||
{
|
||||
hwnd = win->GetHWND();
|
||||
hdc = dc->GetHDC();
|
||||
count = 1;
|
||||
}
|
||||
|
||||
WXHWND hwnd; // window for this DC
|
||||
WXHDC hdc; // the DC handle
|
||||
size_t count; // usage count
|
||||
};
|
||||
|
||||
#include "wx/arrimpl.cpp"
|
||||
|
||||
WX_DEFINE_OBJARRAY(wxArrayDCInfo);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC)
|
||||
IMPLEMENT_CLASS(wxPaintDCEx, wxPaintDC)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
int g_isPainting = 0;
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWindowDC
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxWindowDC::wxWindowDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxWindowDC::wxWindowDC(wxWindow *canvas)
|
||||
{
|
||||
}
|
||||
|
||||
void wxWindowDC::InitDC()
|
||||
{
|
||||
}
|
||||
|
||||
void wxWindowDC::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxClientDC
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxClientDC::wxClientDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxClientDC::wxClientDC(wxWindow *canvas)
|
||||
{
|
||||
}
|
||||
|
||||
void wxClientDC::InitDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxClientDC::~wxClientDC()
|
||||
{
|
||||
}
|
||||
|
||||
void wxClientDC::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPaintDC
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxArrayDCInfo wxPaintDC::ms_cache;
|
||||
|
||||
wxPaintDC::wxPaintDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxPaintDC::wxPaintDC(wxWindow *canvas)
|
||||
{
|
||||
}
|
||||
|
||||
wxPaintDC::~wxPaintDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxPaintDCInfo *wxPaintDC::FindInCache(size_t *index) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WXHDC wxPaintDC::FindDCInCache(wxWindow* win)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* wxPaintDCEx
|
||||
*/
|
||||
|
||||
wxPaintDCEx::wxPaintDCEx(wxWindow *canvas, WXHDC dc) : saveState(0)
|
||||
{
|
||||
}
|
||||
|
||||
wxPaintDCEx::~wxPaintDCEx()
|
||||
{
|
||||
}
|
||||
|
||||
95
src/palmos/dcmemory.cpp
Normal file
95
src/palmos/dcmemory.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcmemory.cpp
|
||||
// Purpose: wxMemoryDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dcmemory.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcmemory.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxMemoryDC::wxMemoryDC()
|
||||
{
|
||||
}
|
||||
|
||||
wxMemoryDC::wxMemoryDC(wxDC *dc)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMemoryDC::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxMemoryDC::CreateCompatible(wxDC *dc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMemoryDC::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
// the rest of this file deals with drawing rectangles workaround, disabled by
|
||||
// default
|
||||
|
||||
#define wxUSE_MEMORY_DC_DRAW_RECTANGLE 0
|
||||
|
||||
#if wxUSE_MEMORY_DC_DRAW_RECTANGLE
|
||||
|
||||
// For some reason, drawing a rectangle on a memory DC has problems.
|
||||
// Use this substitute if we can.
|
||||
static void wxDrawRectangle(wxDC& dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_MEMORY_DC_DRAW_RECTANGLE
|
||||
|
||||
void wxMemoryDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
}
|
||||
|
||||
148
src/palmos/dcprint.cpp
Normal file
148
src/palmos/dcprint.cpp
Normal file
@@ -0,0 +1,148 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/dcprint.cpp
|
||||
// Purpose: wxPrinterDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dcprint.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"
|
||||
#include "wx/log.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
#include "wx/palmos/dib.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcprint.h"
|
||||
#include "math.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPrinterDC construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This form is deprecated
|
||||
wxPrinterDC::wxPrinterDC(const wxString& driver_name,
|
||||
const wxString& device_name,
|
||||
const wxString& file,
|
||||
bool interactive,
|
||||
int orientation)
|
||||
{
|
||||
}
|
||||
|
||||
wxPrinterDC::wxPrinterDC(const wxPrintData& printData)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxPrinterDC::wxPrinterDC(WXHDC dc)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPrinterDC::Init()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPrinterDC {Start/End}{Page/Doc} methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxPrinterDC::StartDoc(const wxString& message)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPrinterDC::EndDoc()
|
||||
{
|
||||
}
|
||||
|
||||
void wxPrinterDC::StartPage()
|
||||
{
|
||||
}
|
||||
|
||||
void wxPrinterDC::EndPage()
|
||||
{
|
||||
}
|
||||
|
||||
// Returns default device and port names
|
||||
static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets an HDC for the specified printer configuration
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst)
|
||||
{
|
||||
return (WXHDC) 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPrinterDC bit blitting/bitmap drawing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// helper of DoDrawBitmap() and DoBlit()
|
||||
static
|
||||
bool DrawBitmapUsingStretchDIBits(HDC hdc,
|
||||
const wxBitmap& bmp,
|
||||
wxCoord x, wxCoord y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPrinterDC::DoDrawBitmap(const wxBitmap& bmp,
|
||||
wxCoord x, wxCoord y,
|
||||
bool useMask)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height,
|
||||
wxDC *source,
|
||||
wxCoord WXUNUSED(xsrc), wxCoord WXUNUSED(ysrc),
|
||||
int WXUNUSED(rop), bool useMask,
|
||||
wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
40
src/palmos/dcscreen.cpp
Normal file
40
src/palmos/dcscreen.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/dcscreen.cpp
|
||||
// Purpose: wxScreenDC class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dcscreen.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"
|
||||
#include "wx/window.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcscreen.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
||||
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC::wxScreenDC()
|
||||
{
|
||||
}
|
||||
|
||||
void wxScreenDC::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
265
src/palmos/dialog.cpp
Normal file
265
src/palmos/dialog.cpp
Normal file
@@ -0,0 +1,265 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/dialog.cpp
|
||||
// Purpose: wxDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/12/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dialog.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/evtloop.h"
|
||||
#include "wx/ptr_scpd.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxDialogStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxDialogStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxNO_BORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
|
||||
// dialog styles
|
||||
wxFLAGS_MEMBER(wxWS_EX_VALIDATE_RECURSIVELY)
|
||||
wxFLAGS_MEMBER(wxSTAY_ON_TOP)
|
||||
wxFLAGS_MEMBER(wxCAPTION)
|
||||
wxFLAGS_MEMBER(wxTHICK_FRAME)
|
||||
wxFLAGS_MEMBER(wxSYSTEM_MENU)
|
||||
wxFLAGS_MEMBER(wxRESIZE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRESIZE_BOX)
|
||||
wxFLAGS_MEMBER(wxCLOSE_BOX)
|
||||
wxFLAGS_MEMBER(wxMAXIMIZE_BOX)
|
||||
wxFLAGS_MEMBER(wxMINIMIZE_BOX)
|
||||
wxEND_FLAGS( wxDialogStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxDialog, wxTopLevelWindow,"wx/dialog.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxDialog)
|
||||
wxPROPERTY( Title, wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxDialogStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxDialog)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxDialog , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle)
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
|
||||
#endif
|
||||
|
||||
BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
|
||||
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
||||
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
||||
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
||||
|
||||
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
||||
|
||||
EVT_CLOSE(wxDialog::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDialogModalData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this is simply a container for any data we need to implement modality which
|
||||
// allows us to avoid changing wxDialog each time the implementation changes
|
||||
class wxDialogModalData
|
||||
{
|
||||
public:
|
||||
wxDialogModalData(wxDialog *dialog) : m_evtLoop(dialog) { }
|
||||
|
||||
void RunLoop()
|
||||
{
|
||||
m_evtLoop.Run();
|
||||
}
|
||||
|
||||
void ExitLoop()
|
||||
{
|
||||
m_evtLoop.Exit();
|
||||
}
|
||||
|
||||
private:
|
||||
wxModalEventLoop m_evtLoop;
|
||||
};
|
||||
|
||||
wxDEFINE_TIED_SCOPED_PTR_TYPE(wxDialogModalData);
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDialog construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxDialog::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxDialog::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// deprecated ctor
|
||||
wxDialog::wxDialog(wxWindow *parent,
|
||||
const wxString& title,
|
||||
bool WXUNUSED(modal),
|
||||
int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
}
|
||||
|
||||
void wxDialog::SetModal(bool WXUNUSED(flag))
|
||||
{
|
||||
}
|
||||
|
||||
wxDialog::~wxDialog()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// showing the dialogs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDialog::IsModalShowing() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxWindow *wxDialog::FindSuitableParent() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool wxDialog::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxDialog::Raise()
|
||||
{
|
||||
}
|
||||
|
||||
// show dialog modally
|
||||
int wxDialog::ShowModal()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void wxDialog::EndModal(int retCode)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin event handlers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Standard buttons
|
||||
void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// dialog window proc
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_CTL3D
|
||||
|
||||
// Define for each class of dialog and control
|
||||
WXHBRUSH wxDialog::OnCtlColor(WXHDC WXUNUSED(pDC),
|
||||
WXHWND WXUNUSED(pWnd),
|
||||
WXUINT WXUNUSED(nCtlColor),
|
||||
WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
return (WXHBRUSH)Ctl3dCtlColorEx(message, wParam, lParam);
|
||||
}
|
||||
|
||||
#endif // wxUSE_CTL3D
|
||||
|
||||
1290
src/palmos/dialup.cpp
Normal file
1290
src/palmos/dialup.cpp
Normal file
File diff suppressed because it is too large
Load Diff
170
src/palmos/dib.cpp
Normal file
170
src/palmos/dib.cpp
Normal file
@@ -0,0 +1,170 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/dib.cpp
|
||||
// Purpose: implements wxDIB class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// License: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/file.h"
|
||||
|
||||
#include "wx/image.h"
|
||||
#include "wx/palmos/dib.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// calculate the number of palette entries needed for the bitmap with this
|
||||
// number of bits per pixel
|
||||
static inline WORD GetNumberOfColours(WORD bitsPerPixel)
|
||||
{
|
||||
// only 1, 4 and 8bpp bitmaps use palettes (well, they could be used with
|
||||
// 24bpp ones too but we don't support this as I think it's quite uncommon)
|
||||
return bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0;
|
||||
}
|
||||
|
||||
// wrapper around ::GetObject() for DIB sections
|
||||
static inline bool GetDIBSection(HBITMAP hbmp, DIBSECTION *ds)
|
||||
{
|
||||
// note that at least under Win9x (this doesn't seem to happen under Win2K
|
||||
// but this doesn't mean anything, of course), GetObject() may return
|
||||
// sizeof(DIBSECTION) for a bitmap which is *not* a DIB section and the way
|
||||
// to check for it is by looking at the bits pointer
|
||||
return ::GetObject(hbmp, sizeof(DIBSECTION), ds) == sizeof(DIBSECTION) &&
|
||||
ds->dsBm.bmBits;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDIB creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDIB::Create(int width, int height, int depth)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDIB::Create(const wxBitmap& bmp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDIB::CopyFromDDB(HBITMAP hbmp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Loading/saving the DIBs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDIB::Load(const wxString& filename)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDIB::Save(const wxString& filename)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDIB accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxDIB::DoGetObject() const
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DDB <-> DIB conversions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
HBITMAP wxDIB::CreateDDB(HDC hdc) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
HBITMAP wxDIB::ConvertToBitmap(const BITMAPINFO *pbmi, HDC hdc, void *bits)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
size_t wxDIB::ConvertFromBitmap(BITMAPINFO *pbi, HBITMAP hbmp)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// palette support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
|
||||
wxPalette *wxDIB::CreatePalette() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxImage support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
|
||||
bool wxDIB::Create(const wxImage& image)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxImage wxDIB::ConvertToImage() const
|
||||
{
|
||||
return wxNullImage;
|
||||
}
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
#endif // wxUSE_WXDIB
|
||||
|
||||
119
src/palmos/dir.cpp
Normal file
119
src/palmos/dir.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/dir.cpp
|
||||
// Purpose: wxDir implementation for Win32
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dir.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif // PCH
|
||||
|
||||
#include "wx/dir.h"
|
||||
#include "wx/filefn.h" // for wxPathExists()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// define the types and functions used for file searching
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 260 // from VC++ headers
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define M_DIR ((wxDirData *)m_data)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDir helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* static */
|
||||
bool wxDir::Exists(const wxString& dir)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDir construction/destruction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDir::wxDir(const wxString& dirname)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxDir::Open(const wxString& dirname)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDir::IsOpened() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString wxDir::GetName() const
|
||||
{
|
||||
wxString name;
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
wxDir::~wxDir()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDir enumerating
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDir::GetFirst(wxString *filename,
|
||||
const wxString& filespec,
|
||||
int flags) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDir::GetNext(wxString *filename) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
143
src/palmos/dirdlg.cpp
Normal file
143
src/palmos/dirdlg.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dirdlg.cpp
|
||||
// Purpose: wxDirDialog
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dirdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
|
||||
#if defined(__WIN95__) && !defined(__GNUWIN32_OLD__) && wxUSE_OLE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/dirdlg.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h" // for GetComCtl32Version()
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 4096 // be generous
|
||||
#endif
|
||||
|
||||
#ifndef BIF_NEWDIALOGSTYLE
|
||||
#define BIF_NEWDIALOGSTYLE 0x0040
|
||||
#endif
|
||||
|
||||
#ifndef BIF_NONEWFOLDERBUTTON
|
||||
#define BIF_NONEWFOLDERBUTTON 0x0200
|
||||
#endif
|
||||
|
||||
#ifndef BIF_EDITBOX
|
||||
#define BIF_EDITBOX 16
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWidgets macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions prototypes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// free the parameter
|
||||
static void ItemListFree(LPITEMIDLIST pidl);
|
||||
|
||||
// the callback proc for the dir dlg
|
||||
static int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp,
|
||||
LPARAM pData);
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDirDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDirDialog::wxDirDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& defaultPath,
|
||||
long style,
|
||||
const wxPoint& WXUNUSED(pos),
|
||||
const wxSize& WXUNUSED(size),
|
||||
const wxString& WXUNUSED(name))
|
||||
{
|
||||
}
|
||||
|
||||
void wxDirDialog::SetPath(const wxString& path)
|
||||
{
|
||||
}
|
||||
|
||||
int wxDirDialog::ShowModal()
|
||||
{
|
||||
return wxID_OK;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static int CALLBACK
|
||||
BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void ItemListFree(LPITEMIDLIST pidl)
|
||||
{
|
||||
if ( pidl )
|
||||
{
|
||||
LPMALLOC pMalloc;
|
||||
SHGetMalloc(&pMalloc);
|
||||
if ( pMalloc )
|
||||
{
|
||||
pMalloc->Free(pidl);
|
||||
pMalloc->Release();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogLastError(wxT("SHGetMalloc"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
#include "../generic/dirdlgg.cpp"
|
||||
#endif // compiler/platform on which the code here compiles
|
||||
|
||||
#endif // wxUSE_DIRDLG
|
||||
276
src/palmos/display.cpp
Normal file
276
src/palmos/display.cpp
Normal file
@@ -0,0 +1,276 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: display.cpp
|
||||
// Purpose: Palm OS Implementation of wxDisplay class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "display.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_DISPLAY
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/frame.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dynload.h"
|
||||
|
||||
#include "wx/display.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef _UNICODE
|
||||
#define WINFUNC(x) _T(#x) L"W"
|
||||
#else
|
||||
#define WINFUNC(x) #x "A"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxDisplayInfo
|
||||
{
|
||||
public:
|
||||
// handle of this monitor used by MonitorXXX() functions, never NULL
|
||||
HMONITOR m_hmon;
|
||||
|
||||
// IDirectDraw object used to control this display, may be NULL
|
||||
IDirectDraw2 *m_pDD2;
|
||||
|
||||
// DirectDraw GUID for this display, only valid when using DirectDraw
|
||||
GUID m_guid;
|
||||
|
||||
// the entire area of this monitor in virtual screen coordinates
|
||||
wxRect m_rect;
|
||||
|
||||
// the display device name for this monitor, empty initially and retrieved
|
||||
// on demand by DoGetName()
|
||||
wxString m_devName;
|
||||
|
||||
wxDisplayInfo() { m_hmon = NULL; m_pDD2 = NULL; }
|
||||
~wxDisplayInfo() { if ( m_pDD2 ) m_pDD2->Release(); }
|
||||
};
|
||||
|
||||
WX_DECLARE_OBJARRAY(wxDisplayInfo, wxDisplayInfoArray);
|
||||
#include "wx/arrimpl.cpp"
|
||||
WX_DEFINE_OBJARRAY(wxDisplayInfoArray);
|
||||
|
||||
// this module is used to cleanup gs_displays array
|
||||
class wxDisplayModule : public wxModule
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit() { return true; }
|
||||
virtual void OnExit();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxDisplayModule)
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDisplayModule, wxModule)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this is not really MT-unsafe as wxDisplay is only going to be used from the
|
||||
// main thread, i.e. we consider that it's a GUI class and so don't protect it
|
||||
static wxDisplayInfoArray *gs_displays = NULL;
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// local functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// initialize gs_displays using DirectX functions
|
||||
static bool DoInitDirectX()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// initialize gs_displays using the standard Windows functions
|
||||
static void DoInitStdWindows()
|
||||
{
|
||||
}
|
||||
|
||||
// this function must be called before accessing gs_displays array as it
|
||||
// creates and initializes it
|
||||
static void InitDisplays()
|
||||
{
|
||||
}
|
||||
|
||||
// convert a DEVMODE to our wxVideoMode
|
||||
wxVideoMode ConvertToVideoMode(const DEVMODE& dm)
|
||||
{
|
||||
return wxVideoMode(160,
|
||||
160,
|
||||
16,
|
||||
0);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDisplayModule
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxDisplayModule::OnExit()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDisplay
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/* static */
|
||||
void wxDisplay::UseDirectX(bool useDX)
|
||||
{
|
||||
}
|
||||
|
||||
// helper of GetFromPoint() and GetFromWindow()
|
||||
static int DisplayFromHMONITOR(HMONITOR hmon)
|
||||
{
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
/* static */
|
||||
size_t wxDisplayBase::GetCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int wxDisplayBase::GetFromPoint ( const wxPoint& pt )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* static */
|
||||
int wxDisplayBase::GetFromWindow(wxWindow *window)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDisplay ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDisplay::wxDisplay ( size_t n )
|
||||
: wxDisplayBase ( n )
|
||||
{
|
||||
}
|
||||
|
||||
wxDisplay::~wxDisplay()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDisplay simple accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDisplay::IsOk() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxRect wxDisplay::GetGeometry() const
|
||||
{
|
||||
wxRect rect;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
wxString wxDisplay::GetName() const
|
||||
{
|
||||
wxString ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
wxString wxDisplay::GetNameForEnumSettings() const
|
||||
{
|
||||
wxString ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// video modes enumeration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxArrayVideoModes
|
||||
wxDisplay::DoGetModesDirectX(const wxVideoMode& WXUNUSED(modeMatch)) const
|
||||
{
|
||||
wxArrayVideoModes modes;
|
||||
|
||||
return modes;
|
||||
}
|
||||
|
||||
wxArrayVideoModes
|
||||
wxDisplay::DoGetModesWindows(const wxVideoMode& modeMatch) const
|
||||
{
|
||||
wxArrayVideoModes modes;
|
||||
|
||||
return modes;
|
||||
}
|
||||
|
||||
wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& modeMatch) const
|
||||
{
|
||||
return gs_useDirectX ? DoGetModesDirectX(modeMatch)
|
||||
: DoGetModesWindows(modeMatch);
|
||||
}
|
||||
|
||||
wxVideoMode wxDisplay::GetCurrentMode() const
|
||||
{
|
||||
wxVideoMode mode;
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// video mode switching
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxDisplay::DoChangeModeDirectX(const wxVideoMode& mode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDisplay::DoChangeModeWindows(const wxVideoMode& mode)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDisplay::ChangeMode(const wxVideoMode& mode)
|
||||
{
|
||||
return gs_useDirectX ? DoChangeModeDirectX(mode)
|
||||
: DoChangeModeWindows(mode);
|
||||
}
|
||||
|
||||
#endif // wxUSE_DISPLAY
|
||||
|
||||
159
src/palmos/dragimag.cpp
Normal file
159
src/palmos/dragimag.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dragimag.cpp
|
||||
// Purpose: wxDragImage
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dragimag.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_DRAGIMAGE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/setup.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/image.h"
|
||||
|
||||
#include "wx/palmos/dragimag.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDragImage, wxObject)
|
||||
|
||||
#define GetHimageList() ((HIMAGELIST) m_hImageList)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDragImage ctors/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDragImage::wxDragImage()
|
||||
{
|
||||
}
|
||||
|
||||
wxDragImage::~wxDragImage()
|
||||
{
|
||||
}
|
||||
|
||||
void wxDragImage::Init()
|
||||
{
|
||||
}
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Create a drag image from a bitmap and optional cursor
|
||||
bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a drag image from an icon and optional cursor
|
||||
bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a drag image from a string and optional cursor
|
||||
bool wxDragImage::Create(const wxString& str, const wxCursor& cursor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
// Create a drag image for the given tree control item
|
||||
bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
// Create a drag image for the given list control item
|
||||
bool wxDragImage::Create(const wxListCtrl& listCtrl, long id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Begin drag
|
||||
bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen, wxRect* rect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||
// corner of the image. This is full screen only. fullScreenRect gives the
|
||||
// position of the window on the screen, to restrict the drag to.
|
||||
bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// End drag
|
||||
bool wxDragImage::EndDrag()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
||||
// is non-NULL, or in screen coordinates if NULL.
|
||||
bool wxDragImage::Move(const wxPoint& pt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDragImage::Show()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxDragImage::Hide()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_DRAGIMAGE
|
||||
30
src/palmos/dummy.cpp
Normal file
30
src/palmos/dummy.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* File: dummy.cc
|
||||
* Purpose: See below
|
||||
* Author: Julian Smart
|
||||
* Created: 1993
|
||||
* Updated:
|
||||
* Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
*/
|
||||
|
||||
/* A dummy file to include wx.h. If precompiling wx.h, I
|
||||
* always start by compiling this and producing the PCH file.
|
||||
* Then subsequent source files use the PCH file.
|
||||
*
|
||||
* If precompiling wx.h for wxWidgets and derived apps,
|
||||
* link dummy.obj with your program (the MSC 7 linker complains otherwise).
|
||||
*
|
||||
* This is the only convenient way I found to use precompiled headers
|
||||
* under MSC 7.
|
||||
*
|
||||
* This will produce a big PCH file.
|
||||
*/
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/msvcrt.h"
|
||||
|
||||
25
src/palmos/dummydll.cpp
Normal file
25
src/palmos/dummydll.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* File: dummydll.cc
|
||||
* Purpose:
|
||||
* Author: Julian Smart
|
||||
* Created: 1993
|
||||
* Updated:
|
||||
* Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
*/
|
||||
|
||||
/* static const char sccsid[] = "@(#)dummydll.cc 1.2 5/9/94"; */
|
||||
|
||||
/*
|
||||
* A dummy file to include wx.h. If precompiling wx.h, I
|
||||
* always start by compiling this and producing the PCH file.
|
||||
* Then subsequent source files use the PCH file.
|
||||
*/
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
// Foils optimizations in Visual C++ (see also app.cpp). Without it,
|
||||
// dummy.obj isn't linked and we get a linker error.
|
||||
#if defined(__VISUALC__)
|
||||
char wxDummyChar=0;
|
||||
#endif
|
||||
|
||||
180
src/palmos/enhmeta.cpp
Normal file
180
src/palmos/enhmeta.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/enhmeta.cpp
|
||||
// Purpose: implementation of wxEnhMetaFileXXX classes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "enhmeta.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_ENH_METAFILE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/metafile.h"
|
||||
#include "wx/clipbrd.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxEnhMetaFile, wxObject)
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC, wxDC)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define GetEMF() ((HENHMETAFILE)m_hMF)
|
||||
#define GetEMFOf(mf) ((HENHMETAFILE)((mf).m_hMF))
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we must pass NULL if the string is empty to metafile functions
|
||||
static inline const wxChar *GetMetaFileName(const wxString& fn)
|
||||
{ return !fn ? (wxChar *)NULL : fn.c_str(); }
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFile
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxEnhMetaFile::Assign(const wxEnhMetaFile& mf)
|
||||
{
|
||||
}
|
||||
|
||||
void wxEnhMetaFile::Free()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSize wxEnhMetaFile::GetSize() const
|
||||
{
|
||||
wxSize size = wxDefaultSize;
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileDC
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename,
|
||||
int width, int height,
|
||||
const wxString& description)
|
||||
{
|
||||
}
|
||||
|
||||
wxEnhMetaFile *wxEnhMetaFileDC::Close()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxEnhMetaFileDC::~wxEnhMetaFileDC()
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileDataObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxDataFormat
|
||||
wxEnhMetaFileDataObject::GetPreferredFormat(Direction WXUNUSED(dir)) const
|
||||
{
|
||||
return wxDF_ENHMETAFILE;
|
||||
}
|
||||
|
||||
size_t wxEnhMetaFileDataObject::GetFormatCount(Direction WXUNUSED(dir)) const
|
||||
{
|
||||
// wxDF_ENHMETAFILE and wxDF_METAFILE
|
||||
return 2;
|
||||
}
|
||||
|
||||
void wxEnhMetaFileDataObject::GetAllFormats(wxDataFormat *formats,
|
||||
Direction WXUNUSED(dir)) const
|
||||
{
|
||||
}
|
||||
|
||||
size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat& format) const
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format,
|
||||
size_t WXUNUSED(len),
|
||||
const void *buf)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEnhMetaFileSimpleDataObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const
|
||||
{
|
||||
return 0u;
|
||||
}
|
||||
|
||||
bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len),
|
||||
const void *buf)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif // wxUSE_ENH_METAFILE
|
||||
164
src/palmos/evtloop.cpp
Normal file
164
src/palmos/evtloop.cpp
Normal file
@@ -0,0 +1,164 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/evtloop.cpp
|
||||
// Purpose: implements wxEventLoop for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.14.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// License: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "evtloop.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/app.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/evtloop.h"
|
||||
|
||||
#include "wx/tooltip.h"
|
||||
#include "wx/except.h"
|
||||
#include "wx/ptr_scpd.h"
|
||||
|
||||
#if wxUSE_THREADS
|
||||
#include "wx/thread.h"
|
||||
|
||||
// define the array of MSG strutures
|
||||
WX_DECLARE_OBJARRAY(MSG, wxMsgArray);
|
||||
|
||||
#include "wx/arrimpl.cpp"
|
||||
|
||||
WX_DEFINE_OBJARRAY(wxMsgArray);
|
||||
#endif // wxUSE_THREADS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this object sets the wxEventLoop given to the ctor as the currently active
|
||||
// one and unsets it in its dtor
|
||||
class wxEventLoopActivator
|
||||
{
|
||||
public:
|
||||
wxEventLoopActivator(wxEventLoop **pActive,
|
||||
wxEventLoop *evtLoop)
|
||||
{
|
||||
m_pActive = pActive;
|
||||
m_evtLoopOld = *pActive;
|
||||
*pActive = evtLoop;
|
||||
}
|
||||
|
||||
~wxEventLoopActivator()
|
||||
{
|
||||
// restore the previously active event loop
|
||||
*m_pActive = m_evtLoopOld;
|
||||
}
|
||||
|
||||
private:
|
||||
wxEventLoop *m_evtLoopOld;
|
||||
wxEventLoop **m_pActive;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// wxEventLoop implementation
|
||||
// ============================================================================
|
||||
|
||||
wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxEventLoop::wxEventLoop()
|
||||
{
|
||||
m_shouldExit = false;
|
||||
m_exitcode = 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEventLoop message processing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxEventLoop::ProcessMessage(WXMSG *msg)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxEventLoop::PreProcessMessage(WXMSG *msg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEventLoop running and exiting
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxEventLoop::IsRunning() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int wxEventLoop::Run()
|
||||
{
|
||||
status_t error;
|
||||
EventType event;
|
||||
|
||||
do {
|
||||
wxTheApp && wxTheApp->ProcessIdle();
|
||||
|
||||
EvtGetEvent(&event, evtWaitForever);
|
||||
|
||||
if (SysHandleEvent(&event))
|
||||
continue;
|
||||
|
||||
if (MenuHandleEvent(0, &event, &error))
|
||||
continue;
|
||||
|
||||
FrmDispatchEvent(&event);
|
||||
|
||||
} while (event.eType != appStopEvent);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxEventLoop::Exit(int rc)
|
||||
{
|
||||
FrmCloseAllForms();
|
||||
|
||||
EventType AppStop;
|
||||
AppStop.eType=appStopEvent;
|
||||
EvtAddEventToQueue(&AppStop);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxEventLoop message processing dispatching
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxEventLoop::Pending() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxEventLoop::Dispatch()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
210
src/palmos/fdrepdlg.cpp
Normal file
210
src/palmos/fdrepdlg.cpp
Normal file
@@ -0,0 +1,210 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/fdrepdlg.cpp
|
||||
// Purpose: wxFindReplaceDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10.13.04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "mswfdrepdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_FINDREPLDLG
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/fdrepdlg.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions prototypes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFindReplaceDialog, wxDialog)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialogImpl: the internals of wxFindReplaceDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFindReplaceDialogImpl
|
||||
{
|
||||
public:
|
||||
wxFindReplaceDialogImpl(wxFindReplaceDialog *dialog, int flagsWX);
|
||||
~wxFindReplaceDialogImpl();
|
||||
|
||||
void InitFindWhat(const wxString& str);
|
||||
void InitReplaceWith(const wxString& str);
|
||||
|
||||
void SubclassDialog(HWND hwnd);
|
||||
|
||||
static UINT GetFindDialogMessage() { return ms_msgFindDialog; }
|
||||
|
||||
// only for passing to ::FindText or ::ReplaceText
|
||||
FINDREPLACE *GetPtrFindReplace() { return &m_findReplace; }
|
||||
|
||||
// set/query the "closed by user" flag
|
||||
void SetClosedByUser() { m_wasClosedByUser = TRUE; }
|
||||
bool WasClosedByUser() const { return m_wasClosedByUser; }
|
||||
|
||||
private:
|
||||
void InitString(const wxString& str, LPTSTR *ppStr, WORD *pLen);
|
||||
|
||||
// the owner of the dialog
|
||||
HWND m_hwndOwner;
|
||||
|
||||
// the previous window proc of our owner
|
||||
WNDPROC m_oldParentWndProc;
|
||||
|
||||
// the find replace data used by the dialog
|
||||
FINDREPLACE m_findReplace;
|
||||
|
||||
// TRUE if the user closed us, FALSE otherwise
|
||||
bool m_wasClosedByUser;
|
||||
|
||||
// registered Message for Dialog
|
||||
static UINT ms_msgFindDialog;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxFindReplaceDialogImpl)
|
||||
};
|
||||
|
||||
UINT wxFindReplaceDialogImpl::ms_msgFindDialog = 0;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialogImpl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFindReplaceDialogImpl::wxFindReplaceDialogImpl(wxFindReplaceDialog *dialog,
|
||||
int flagsWX)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFindReplaceDialogImpl::InitString(const wxString& str,
|
||||
LPTSTR *ppStr, WORD *pLen)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFindReplaceDialogImpl::InitFindWhat(const wxString& str)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFindReplaceDialogImpl::InitReplaceWith(const wxString& str)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFindReplaceDialogImpl::SubclassDialog(HWND hwnd)
|
||||
{
|
||||
}
|
||||
|
||||
wxFindReplaceDialogImpl::~wxFindReplaceDialogImpl()
|
||||
{
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// wxFindReplaceDialog implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog ctors/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFindReplaceDialog::Init()
|
||||
{
|
||||
}
|
||||
|
||||
wxFindReplaceDialog::wxFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int flags)
|
||||
: wxFindReplaceDialogBase(parent, data, title, flags)
|
||||
{
|
||||
}
|
||||
|
||||
wxFindReplaceDialog::~wxFindReplaceDialog()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFindReplaceDialog::Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString &title,
|
||||
int flags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceData show/hide
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFindReplaceDialog::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog title handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFindReplaceDialog::SetTitle( const wxString& title)
|
||||
{
|
||||
}
|
||||
|
||||
wxString wxFindReplaceDialog::GetTitle() const
|
||||
{
|
||||
return wxString;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFindReplaceDialog position/size
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFindReplaceDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(width), int WXUNUSED(height),
|
||||
int WXUNUSED(sizeFlags))
|
||||
{
|
||||
// ignore - we can't change the size of this standard dialog
|
||||
return;
|
||||
}
|
||||
|
||||
// NB: of course, both of these functions are completely bogus, but it's better
|
||||
// than nothing
|
||||
void wxFindReplaceDialog::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxFindReplaceDialog::DoGetClientSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_FINDREPLDLG
|
||||
|
||||
106
src/palmos/filedlg.cpp
Normal file
106
src/palmos/filedlg.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/filedlg.cpp
|
||||
// Purpose: wxFileDialog
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "filedlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_FILEDLG && !defined(__SMARTPHONE__)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wx/filename.h"
|
||||
#include "wx/tokenzr.h"
|
||||
|
||||
#ifndef OFN_EXPLORER
|
||||
#define OFN_EXPLORER 0x00080000
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define wxMAXPATH 1024
|
||||
|
||||
# define wxMAXFILE 1024
|
||||
|
||||
# define wxMAXEXT 5
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& defaultDir,
|
||||
const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style,
|
||||
const wxPoint& pos)
|
||||
:wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
void wxFileDialog::GetPaths(wxArrayString& paths) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxFileDialog::GetFilenames(wxArrayString& files) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxFileDialog::SetPath(const wxString& path)
|
||||
{
|
||||
}
|
||||
|
||||
int wxFileDialog::ShowModal()
|
||||
{
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
#endif // wxUSE_FILEDLG
|
||||
|
||||
535
src/palmos/font.cpp
Normal file
535
src/palmos/font.cpp
Normal file
@@ -0,0 +1,535 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/font.cpp
|
||||
// Purpose: wxFont class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/14/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "font.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/setup.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/encinfo.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/fontmap.h"
|
||||
|
||||
#include "wx/tokenzr.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
wxBEGIN_ENUM( wxFontFamily )
|
||||
wxENUM_MEMBER( wxDEFAULT )
|
||||
wxENUM_MEMBER( wxDECORATIVE )
|
||||
wxENUM_MEMBER( wxROMAN )
|
||||
wxENUM_MEMBER( wxSCRIPT )
|
||||
wxENUM_MEMBER( wxSWISS )
|
||||
wxENUM_MEMBER( wxMODERN )
|
||||
wxENUM_MEMBER( wxTELETYPE )
|
||||
wxEND_ENUM( wxFontFamily )
|
||||
|
||||
wxBEGIN_ENUM( wxFontStyle )
|
||||
wxENUM_MEMBER( wxNORMAL )
|
||||
wxENUM_MEMBER( wxITALIC )
|
||||
wxENUM_MEMBER( wxSLANT )
|
||||
wxEND_ENUM( wxFontStyle )
|
||||
|
||||
wxBEGIN_ENUM( wxFontWeight )
|
||||
wxENUM_MEMBER( wxNORMAL )
|
||||
wxENUM_MEMBER( wxLIGHT )
|
||||
wxENUM_MEMBER( wxBOLD )
|
||||
wxEND_ENUM( wxFontWeight )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI(wxFont, wxGDIObject,"wx/font.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxFont)
|
||||
wxPROPERTY( Size,int, SetPointSize, GetPointSize, 12 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Family, int , SetFamily, GetFamily, (int)wxDEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontFamily
|
||||
wxPROPERTY( Style, int , SetStyle, GetStyle, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontStyle
|
||||
wxPROPERTY( Weight, int , SetWeight, GetWeight, (int)wxNORMAL , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // wxFontWeight
|
||||
wxPROPERTY( Underlined, bool , SetUnderlined, GetUnderlined, false , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Face, wxString , SetFaceName, GetFaceName, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Encoding, wxFontEncoding , SetEncoding, GetEncoding, wxFONTENCODING_DEFAULT , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxFont , int , Size , int , Family , int , Style , int , Weight , bool , Underlined , wxString , Face )
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxFont)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontRefData - the internal description of the font
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
// constructors
|
||||
wxFontRefData()
|
||||
{
|
||||
Init(-1, wxSize(0, 0), FALSE, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL,
|
||||
wxFONTWEIGHT_NORMAL, FALSE, wxEmptyString,
|
||||
wxFONTENCODING_DEFAULT);
|
||||
}
|
||||
|
||||
wxFontRefData(int size,
|
||||
const wxSize& pixelSize,
|
||||
bool sizeUsingPixels,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
Init(size, pixelSize, sizeUsingPixels, family, style, weight,
|
||||
underlined, faceName, encoding);
|
||||
}
|
||||
|
||||
wxFontRefData(const wxNativeFontInfo& info, WXHFONT hFont = 0)
|
||||
{
|
||||
Init(info, hFont);
|
||||
}
|
||||
|
||||
wxFontRefData(const wxFontRefData& data)
|
||||
{
|
||||
if ( data.m_nativeFontInfoOk )
|
||||
{
|
||||
Init(data.m_nativeFontInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
Init(data.m_pointSize, data.m_pixelSize, data.m_sizeUsingPixels,
|
||||
data.m_family, data.m_style, data.m_weight,
|
||||
data.m_underlined, data.m_faceName, data.m_encoding);
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~wxFontRefData();
|
||||
|
||||
// operations
|
||||
bool Alloc(wxFont *font);
|
||||
|
||||
void Free();
|
||||
|
||||
// all wxFont accessors
|
||||
int GetPointSize() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetPointSize()
|
||||
: m_pointSize;
|
||||
}
|
||||
|
||||
wxSize GetPixelSize() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetPixelSize()
|
||||
: m_pixelSize;
|
||||
}
|
||||
|
||||
bool IsUsingSizeInPixels() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? true : m_sizeUsingPixels;
|
||||
}
|
||||
|
||||
int GetFamily() const
|
||||
{
|
||||
return m_family;
|
||||
}
|
||||
|
||||
int GetStyle() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetStyle()
|
||||
: m_style;
|
||||
}
|
||||
|
||||
int GetWeight() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetWeight()
|
||||
: m_weight;
|
||||
}
|
||||
|
||||
bool GetUnderlined() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetUnderlined()
|
||||
: m_underlined;
|
||||
}
|
||||
|
||||
wxString GetFaceName() const
|
||||
{
|
||||
wxString s;
|
||||
if ( m_nativeFontInfoOk )
|
||||
s = m_nativeFontInfo.GetFaceName();
|
||||
else
|
||||
s = m_faceName;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
wxFontEncoding GetEncoding() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetEncoding()
|
||||
: m_encoding;
|
||||
}
|
||||
|
||||
WXHFONT GetHFONT() const { return m_hFont; }
|
||||
|
||||
// ... and setters
|
||||
void SetPointSize(int pointSize)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
{
|
||||
m_nativeFontInfo.SetPointSize(pointSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pointSize = pointSize;
|
||||
m_sizeUsingPixels = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void SetPixelSize(const wxSize& pixelSize)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
{
|
||||
m_nativeFontInfo.SetPixelSize(pixelSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pixelSize = pixelSize;
|
||||
m_sizeUsingPixels = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void SetFamily(int family)
|
||||
{
|
||||
m_family = family;
|
||||
}
|
||||
|
||||
void SetStyle(int style)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
m_nativeFontInfo.SetStyle((wxFontStyle)style);
|
||||
else
|
||||
m_style = style;
|
||||
}
|
||||
|
||||
void SetWeight(int weight)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
m_nativeFontInfo.SetWeight((wxFontWeight)weight);
|
||||
else
|
||||
m_weight = weight;
|
||||
}
|
||||
|
||||
void SetFaceName(const wxString& faceName)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
m_nativeFontInfo.SetFaceName(faceName);
|
||||
else
|
||||
m_faceName = faceName;
|
||||
}
|
||||
|
||||
void SetUnderlined(bool underlined)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
m_nativeFontInfo.SetUnderlined(underlined);
|
||||
else
|
||||
m_underlined = underlined;
|
||||
}
|
||||
|
||||
void SetEncoding(wxFontEncoding encoding)
|
||||
{
|
||||
if ( m_nativeFontInfoOk )
|
||||
m_nativeFontInfo.SetEncoding(encoding);
|
||||
else
|
||||
m_encoding = encoding;
|
||||
}
|
||||
|
||||
// native font info tests
|
||||
bool HasNativeFontInfo() const { return m_nativeFontInfoOk; }
|
||||
|
||||
const wxNativeFontInfo& GetNativeFontInfo() const
|
||||
{ return m_nativeFontInfo; }
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init(int size,
|
||||
const wxSize& pixelSize,
|
||||
bool sizeUsingPixels,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding);
|
||||
|
||||
void Init(const wxNativeFontInfo& info, WXHFONT hFont = 0);
|
||||
|
||||
// font characterstics
|
||||
int m_pointSize;
|
||||
wxSize m_pixelSize;
|
||||
bool m_sizeUsingPixels;
|
||||
int m_family;
|
||||
int m_style;
|
||||
int m_weight;
|
||||
bool m_underlined;
|
||||
wxString m_faceName;
|
||||
wxFontEncoding m_encoding;
|
||||
|
||||
// Windows font handle
|
||||
WXHFONT m_hFont;
|
||||
|
||||
// Native font info
|
||||
wxNativeFontInfo m_nativeFontInfo;
|
||||
bool m_nativeFontInfoOk;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontRefData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFontRefData::Init(int pointSize,
|
||||
const wxSize& pixelSize,
|
||||
bool sizeUsingPixels,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFontRefData::Init(const wxNativeFontInfo& info, WXHFONT hFont)
|
||||
{
|
||||
}
|
||||
|
||||
wxFontRefData::~wxFontRefData()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFontRefData::Alloc(wxFont *font)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxFontRefData::Free()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNativeFontInfo
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxNativeFontInfo::SetPixelSize(const wxSize& pixelSize)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFont
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFont::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFont::wxFont(const wxString& fontdesc)
|
||||
{
|
||||
}
|
||||
|
||||
/* Constructor for a font. Note that the real construction is done
|
||||
* in wxDC::SetFont, when information is available about scaling etc.
|
||||
*/
|
||||
bool wxFont::DoCreate(int pointSize,
|
||||
const wxSize& pixelSize,
|
||||
bool sizeUsingPixels,
|
||||
int family,
|
||||
int style,
|
||||
int weight,
|
||||
bool underlined,
|
||||
const wxString& faceName,
|
||||
wxFontEncoding encoding)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFont::~wxFont()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// real implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFont::RealizeResource()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFont::FreeResource(bool WXUNUSED(force))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHANDLE wxFont::GetResourceHandle() const
|
||||
{
|
||||
return (WXHANDLE)0;
|
||||
}
|
||||
|
||||
WXHFONT wxFont::GetHFONT() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxFont::IsFree() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxFont::Unshare()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// change font attribute: we recreate font when doing it
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFont::SetPointSize(int pointSize)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetPixelSize(const wxSize& pixelSize)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetFamily(int family)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetStyle(int style)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetWeight(int weight)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetFaceName(const wxString& faceName)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetUnderlined(bool underlined)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::SetEncoding(wxFontEncoding encoding)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFont::DoSetNativeFontInfo(const wxNativeFontInfo& info)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxFont::GetPointSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxSize wxFont::GetPixelSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
bool wxFont::IsUsingSizeInPixels() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxFont::GetFamily() const
|
||||
{
|
||||
return wxFONTFAMILY_ROMAN;
|
||||
}
|
||||
|
||||
int wxFont::GetStyle() const
|
||||
{
|
||||
return wxFONTSTYLE_NORMAL;
|
||||
}
|
||||
|
||||
int wxFont::GetWeight() const
|
||||
{
|
||||
return wxFONTWEIGHT_NORMAL;
|
||||
}
|
||||
|
||||
bool wxFont::GetUnderlined() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString wxFont::GetFaceName() const
|
||||
{
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
wxFontEncoding wxFont::GetEncoding() const
|
||||
{
|
||||
return wxFONTENCODING_SYSTEM;
|
||||
}
|
||||
|
||||
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool wxFont::IsFixedWidth() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
68
src/palmos/fontdlg.cpp
Normal file
68
src/palmos/fontdlg.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/fontdlg.cpp
|
||||
// Purpose: wxFontDialog class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "fontdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_FONTDLG
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/fontdlg.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxFontDialog::ShowModal()
|
||||
{
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
#endif // wxUSE_FONTDLG
|
||||
155
src/palmos/fontenum.cpp
Normal file
155
src/palmos/fontenum.cpp
Normal file
@@ -0,0 +1,155 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/fontenum.cpp
|
||||
// Purpose: wxFontEnumerator class for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "fontenum.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_FONTMAP
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/font.h"
|
||||
#include "wx/encinfo.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/fontenum.h"
|
||||
#include "wx/fontmap.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the helper class which calls ::EnumFontFamilies() and whose OnFont() is
|
||||
// called from the callback passed to this function and, in its turn, calls the
|
||||
// appropariate wxFontEnumerator method
|
||||
class wxFontEnumeratorHelper
|
||||
{
|
||||
public:
|
||||
wxFontEnumeratorHelper(wxFontEnumerator *fontEnum);
|
||||
|
||||
// control what exactly are we enumerating
|
||||
// we enumerate fonts with given enocding
|
||||
bool SetEncoding(wxFontEncoding encoding);
|
||||
// we enumerate fixed-width fonts
|
||||
void SetFixedOnly(bool fixedOnly) { m_fixedOnly = fixedOnly; }
|
||||
// we enumerate the encodings available in this family
|
||||
void SetFamily(const wxString& family);
|
||||
|
||||
// call to start enumeration
|
||||
void DoEnumerate();
|
||||
|
||||
// called by our font enumeration proc
|
||||
bool OnFont(const LPLOGFONT lf, const LPTEXTMETRIC tm) const;
|
||||
|
||||
private:
|
||||
// the object we forward calls to OnFont() to
|
||||
wxFontEnumerator *m_fontEnum;
|
||||
|
||||
// if != -1, enum only fonts which have this encoding
|
||||
int m_charset;
|
||||
|
||||
// if not empty, enum only the fonts with this facename
|
||||
wxString m_facename;
|
||||
|
||||
// if not empty, enum only the fonts in this family
|
||||
wxString m_family;
|
||||
|
||||
// if TRUE, enum only fixed fonts
|
||||
bool m_fixedOnly;
|
||||
|
||||
// if TRUE, we enumerate the encodings, not fonts
|
||||
bool m_enumEncodings;
|
||||
|
||||
// the list of charsets we already found while enumerating charsets
|
||||
wxArrayInt m_charsets;
|
||||
|
||||
// the list of facenames we already found while enumerating facenames
|
||||
wxArrayString m_facenames;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxFontEnumeratorHelper)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __WXMICROWIN__
|
||||
int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
|
||||
DWORD dwStyle, LONG lParam);
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontEnumeratorHelper
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFontEnumeratorHelper::wxFontEnumeratorHelper(wxFontEnumerator *fontEnum)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFontEnumeratorHelper::SetFamily(const wxString& family)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#define wxFONTENUMPROC FONTENUMPROC
|
||||
|
||||
void wxFontEnumeratorHelper::DoEnumerate()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf,
|
||||
const LPTEXTMETRIC tm) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontEnumerator
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding,
|
||||
bool fixedWidthOnly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFontEnumerator::EnumerateEncodings(const wxString& family)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_FONTMAP
|
||||
77
src/palmos/fontutil.cpp
Normal file
77
src/palmos/fontutil.cpp
Normal file
@@ -0,0 +1,77 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/fontutil.cpp
|
||||
// Purpose: font-related helper functions
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "fontutil.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"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/encinfo.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/fontmap.h"
|
||||
|
||||
#include "wx/tokenzr.h"
|
||||
|
||||
#ifndef HANGUL_CHARSET
|
||||
# define HANGUL_CHARSET 129
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNativeEncodingInfo
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxGetNativeFontEncoding(wxFontEncoding encoding,
|
||||
wxNativeEncodingInfo *info)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontEncoding <-> CHARSET_XXX
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFontEncoding wxGetFontEncFromCharSet(int cs)
|
||||
{
|
||||
return wxFONTENCODING_SYSTEM;
|
||||
}
|
||||
395
src/palmos/frame.cpp
Normal file
395
src/palmos/frame.cpp
Normal file
@@ -0,0 +1,395 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/frame.cpp
|
||||
// Purpose: wxFrame
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "frame.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/panel.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/generic/statusbr.h"
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
#include "wx/toolbar.h"
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#include "wx/menuitem.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#ifdef __WXUNIVERSAL__
|
||||
#include "wx/univ/theme.h"
|
||||
#include "wx/univ/colschem.h"
|
||||
#endif // __WXUNIVERSAL__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event tables
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
|
||||
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
||||
EVT_PAINT(wxFrame::OnPaint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxFrameStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxFrameStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
// frame styles
|
||||
wxFLAGS_MEMBER(wxSTAY_ON_TOP)
|
||||
wxFLAGS_MEMBER(wxCAPTION)
|
||||
wxFLAGS_MEMBER(wxTHICK_FRAME)
|
||||
wxFLAGS_MEMBER(wxSYSTEM_MENU)
|
||||
wxFLAGS_MEMBER(wxRESIZE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRESIZE_BOX)
|
||||
wxFLAGS_MEMBER(wxCLOSE_BOX)
|
||||
wxFLAGS_MEMBER(wxMAXIMIZE_BOX)
|
||||
wxFLAGS_MEMBER(wxMINIMIZE_BOX)
|
||||
|
||||
wxFLAGS_MEMBER(wxFRAME_TOOL_WINDOW)
|
||||
wxFLAGS_MEMBER(wxFRAME_FLOAT_ON_PARENT)
|
||||
|
||||
wxFLAGS_MEMBER(wxFRAME_SHAPED)
|
||||
|
||||
wxEND_FLAGS( wxFrameStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxFrame, wxTopLevelWindow,"wx/frame.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxFrame)
|
||||
wxEVENT_PROPERTY( Menu , wxEVT_COMMAND_MENU_SELECTED , wxCommandEvent)
|
||||
|
||||
wxPROPERTY( Title,wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxFrameStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxPROPERTY( MenuBar , wxMenuBar * , SetMenuBar , GetMenuBar , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxFrame)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxFrame , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle)
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// static class members
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
#if wxUSE_NATIVE_STATUSBAR
|
||||
bool wxFrame::m_useNativeStatusBar = TRUE;
|
||||
#else
|
||||
bool wxFrame::m_useNativeStatusBar = FALSE;
|
||||
#endif
|
||||
#endif // wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// creation/destruction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFrame::Init()
|
||||
{
|
||||
StatusBar=NULL;
|
||||
}
|
||||
|
||||
bool wxFrame::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name, this) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxFrame::~wxFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFrame client size calculations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFrame::DoSetClientSize(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
|
||||
void wxFrame::DoGetClientSize(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFrame: various geometry-related functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxFrame::Raise()
|
||||
{
|
||||
}
|
||||
|
||||
// generate an artificial resize event
|
||||
void wxFrame::SendSizeEvent()
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
wxStatusBar *wxFrame::OnCreateStatusBar(int number,
|
||||
long style,
|
||||
wxWindowID id,
|
||||
const wxString& name)
|
||||
{
|
||||
wxStatusBar *statusBar = NULL;
|
||||
|
||||
#if wxUSE_NATIVE_STATUSBAR
|
||||
if ( !UsesNativeStatusBar() )
|
||||
{
|
||||
statusBar = (wxStatusBar *)new wxStatusBarGeneric(this, id, style);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
statusBar = new wxStatusBar(this, id, style, name);
|
||||
}
|
||||
|
||||
statusBar->SetFieldsCount(number);
|
||||
|
||||
StatusBar=statusBar;
|
||||
return statusBar;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxFrame::PositionStatusBar()
|
||||
{
|
||||
}
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
|
||||
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
|
||||
{
|
||||
wxFrameBase::AttachMenuBar(menubar);
|
||||
|
||||
if ( !menubar )
|
||||
{
|
||||
// actually remove the menu from the frame
|
||||
m_hMenu = (WXHMENU)0;
|
||||
}
|
||||
}
|
||||
|
||||
void wxFrame::InternalSetMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxFrame::HandleMenuOpen()
|
||||
{
|
||||
if(!m_frameMenuBar)
|
||||
return false;
|
||||
|
||||
m_frameMenuBar->LoadMenu();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxFrame::HandleMenuSelect(int ItemID)
|
||||
{
|
||||
if (!m_frameMenuBar)
|
||||
return false;
|
||||
|
||||
int item=m_frameMenuBar->ProcessCommand(ItemID);
|
||||
if(item==-1)
|
||||
return false;
|
||||
|
||||
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, item);
|
||||
commandEvent.SetEventObject(this);
|
||||
|
||||
GetEventHandler()->ProcessEvent(commandEvent);
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
// Responds to colour changes, and passes event on to children.
|
||||
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxFrame::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
#if wxUSE_STATUSBAR
|
||||
if(StatusBar!=NULL)
|
||||
StatusBar->DrawStatusBar();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Pass TRUE to show full screen, FALSE to restore.
|
||||
bool wxFrame::ShowFullScreen(bool show, long style)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// tool/status bar stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
|
||||
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxFrame::PositionToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// frame state (iconized/maximized/...)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// propagate our state change to all child frames: this allows us to emulate X
|
||||
// Windows behaviour where child frames float independently of the parent one
|
||||
// on the desktop, but are iconized/restored with it
|
||||
void wxFrame::IconizeChildFrames(bool bIconize)
|
||||
{
|
||||
}
|
||||
|
||||
WXHICON wxFrame::GetDefaultIcon() const
|
||||
{
|
||||
// we don't have any standard icons (any more)
|
||||
return (WXHICON)0;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// message processing
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// preprocessing
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxFrame::MSWTranslateMessage(WXMSG* pMsg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// our private (non virtual) message handlers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxFrame::HandlePaint()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFrame::HandleSize(int x, int y, WXUINT id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// the window proc for wxFrame
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFrame size management: we exclude the areas taken by menu/status/toolbars
|
||||
// from the client area, so the client area is what's really available for the
|
||||
// frame contents
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// get the origin of the client area in the client coordinates
|
||||
wxPoint wxFrame::GetClientAreaOrigin() const
|
||||
{
|
||||
wxPoint pt;
|
||||
return pt;
|
||||
}
|
||||
177
src/palmos/gauge.cpp
Normal file
177
src/palmos/gauge.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/gauge.cpp
|
||||
// Purpose: wxGauge class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "gauge.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_GAUGE
|
||||
|
||||
#include "wx/gauge.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef PBS_SMOOTH
|
||||
#define PBS_SMOOTH 0x01
|
||||
#endif
|
||||
|
||||
#ifndef PBS_VERTICAL
|
||||
#define PBS_VERTICAL 0x04
|
||||
#endif
|
||||
|
||||
#ifndef PBM_SETBARCOLOR
|
||||
#define PBM_SETBARCOLOR (WM_USER+9)
|
||||
#endif
|
||||
|
||||
#ifndef PBM_SETBKCOLOR
|
||||
#define PBM_SETBKCOLOR 0x2001
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxGaugeStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxGaugeStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxGA_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxGA_VERTICAL)
|
||||
wxFLAGS_MEMBER(wxGA_PROGRESSBAR)
|
||||
wxFLAGS_MEMBER(wxGA_SMOOTH)
|
||||
|
||||
wxEND_FLAGS( wxGaugeStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxGauge, wxControl,"wx/gauge.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxGauge)
|
||||
wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( ShadowWidth , int , SetShadowWidth, GetShadowWidth, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( BezelFace , int , SetBezelFace, GetBezelFace, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxGaugeStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxGauge)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxGauge , wxWindow* , Parent , wxWindowID , Id , int , Range , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// wxGauge implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGauge creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxGauge::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxGauge::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGauge geometry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxGauge::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGauge setters
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxGauge::SetRange(int r)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGauge::SetValue(int pos)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxGauge::SetForegroundColour(const wxColour& col)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxGauge::SetBackgroundColour(const wxColour& col)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_GAUGE
|
||||
|
||||
119
src/palmos/gdiimage.cpp
Normal file
119
src/palmos/gdiimage.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/gdiimage.cpp
|
||||
// Purpose: wxGDIImage implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "gdiimage.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"
|
||||
#include "wx/log.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/app.h"
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/palmos/gdiimage.h"
|
||||
|
||||
#if wxUSE_WXDIB
|
||||
#include "wx/palmos/dib.h"
|
||||
#endif
|
||||
|
||||
#include "wx/file.h"
|
||||
|
||||
#include "wx/listimpl.cpp"
|
||||
WX_DEFINE_LIST(wxGDIImageHandlerList);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// auxiliary functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
wxGDIImageHandlerList wxGDIImage::ms_handlers;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIImage functions forwarded to wxGDIImageRefData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxGDIImage::FreeResource(bool WXUNUSED(force))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHANDLE wxGDIImage::GetResourceHandle() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGDIImage handler stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxGDIImage::AddHandler(wxGDIImageHandler *handler)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGDIImage::InsertHandler(wxGDIImageHandler *handler)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxGDIImage::RemoveHandler(const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxGDIImageHandler *wxGDIImage::FindHandler(const wxString& extension,
|
||||
long type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxGDIImageHandler *wxGDIImage::FindHandler(long type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxGDIImage::CleanUpHandlers()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGDIImage::InitStandardHandlers()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
45
src/palmos/gdiobj.cpp
Normal file
45
src/palmos/gdiobj.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gdiobj.cpp
|
||||
// Purpose: wxGDIObject class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "gdiobj.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/setup.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
||||
|
||||
/*
|
||||
void wxGDIObject::IncrementResourceUsage(void)
|
||||
{
|
||||
};
|
||||
|
||||
void wxGDIObject::DecrementResourceUsage(void)
|
||||
{
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
279
src/palmos/glcanvas.cpp
Normal file
279
src/palmos/glcanvas.cpp
Normal file
@@ -0,0 +1,279 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/glcanvas.cpp
|
||||
// Purpose: wxGLCanvas, for using OpenGL with wxWidgets
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "glcanvas.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_GLCANVAS
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// DLL options compatibility check:
|
||||
#include "wx/build.h"
|
||||
WX_CHECK_BUILD_OPTIONS("wxGL")
|
||||
|
||||
#include "wx/glcanvas.h"
|
||||
|
||||
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
|
||||
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
|
||||
|
||||
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/*
|
||||
* GLContext implementation
|
||||
*/
|
||||
|
||||
wxGLContext::wxGLContext(bool WXUNUSED(isRGB), wxGLCanvas *win, const wxPalette& WXUNUSED(palette))
|
||||
{
|
||||
}
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
bool WXUNUSED(isRGB), wxGLCanvas *win,
|
||||
const wxPalette& WXUNUSED(palette),
|
||||
const wxGLContext *other /* for sharing display lists */
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
wxGLContext::~wxGLContext()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLContext::SwapBuffers()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLContext::SetCurrent()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLContext::SetColour(const wxChar *colour)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
|
||||
EVT_SIZE(wxGLCanvas::OnSize)
|
||||
EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
|
||||
EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette) : wxWindow()
|
||||
{
|
||||
}
|
||||
|
||||
wxGLCanvas::wxGLCanvas( wxWindow *parent,
|
||||
const wxGLContext *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette )
|
||||
: wxWindow()
|
||||
{
|
||||
}
|
||||
|
||||
// Not very useful for wxMSW, but this is to be wxGTK compliant
|
||||
|
||||
wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette ):
|
||||
wxWindow()
|
||||
{
|
||||
}
|
||||
|
||||
wxGLCanvas::~wxGLCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
// Replaces wxWindow::Create functionality, since we need to use a different
|
||||
// window class
|
||||
bool wxGLCanvas::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetupPalette(const wxPalette& palette)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalette wxGLCanvas::CreateDefaultPalette()
|
||||
{
|
||||
wxPalette palette;
|
||||
|
||||
return palette;
|
||||
}
|
||||
|
||||
void wxGLCanvas::SwapBuffers()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetCurrent()
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetColour(const wxChar *colour)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnPaletteChanged(wxPaletteChangedEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void glArrayElementEXT(GLint WXUNUSED(i))
|
||||
{
|
||||
}
|
||||
|
||||
void glColorPointerEXT(GLint WXUNUSED(size), GLenum WXUNUSED(type), GLsizei WXUNUSED(stride), GLsizei WXUNUSED(count), const GLvoid *WXUNUSED(pointer))
|
||||
{
|
||||
}
|
||||
|
||||
void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
|
||||
{
|
||||
}
|
||||
|
||||
void glEdgeFlagPointerEXT(GLsizei WXUNUSED(stride), GLsizei WXUNUSED(count), const GLboolean *WXUNUSED(pointer))
|
||||
{
|
||||
}
|
||||
|
||||
void glGetPointervEXT(GLenum WXUNUSED(pname), GLvoid* *WXUNUSED(params))
|
||||
{
|
||||
}
|
||||
|
||||
void glIndexPointerEXT(GLenum WXUNUSED(type), GLsizei WXUNUSED(stride), GLsizei WXUNUSED(count), const GLvoid *WXUNUSED(pointer))
|
||||
{
|
||||
}
|
||||
|
||||
void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glTexCoordPointerEXT(GLint WXUNUSED(size), GLenum WXUNUSED(type), GLsizei WXUNUSED(stride), GLsizei WXUNUSED(count), const GLvoid *WXUNUSED(pointer))
|
||||
{
|
||||
}
|
||||
|
||||
void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
|
||||
{
|
||||
}
|
||||
|
||||
void glColorSubtableEXT(GLenum WXUNUSED(target), GLsizei WXUNUSED(start), GLsizei WXUNUSED(count), GLenum WXUNUSED(format), GLenum WXUNUSED(type), const GLvoid *WXUNUSED(table))
|
||||
{
|
||||
}
|
||||
|
||||
void glColorTableEXT(GLenum WXUNUSED(target), GLenum WXUNUSED(internalformat), GLsizei WXUNUSED(width), GLenum WXUNUSED(format), GLenum WXUNUSED(type), const GLvoid *WXUNUSED(table))
|
||||
{
|
||||
}
|
||||
|
||||
void glCopyColorTableEXT(GLenum WXUNUSED(target), GLenum WXUNUSED(internalformat), GLint WXUNUSED(x), GLint WXUNUSED(y), GLsizei WXUNUSED(width))
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTableEXT(GLenum WXUNUSED(target), GLenum WXUNUSED(format), GLenum WXUNUSED(type), GLvoid *WXUNUSED(table))
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTableParamaterfvEXT(GLenum WXUNUSED(target), GLenum WXUNUSED(pname), GLfloat *WXUNUSED(params))
|
||||
{
|
||||
}
|
||||
|
||||
void glGetColorTavleParameterivEXT(GLenum WXUNUSED(target), GLenum WXUNUSED(pname), GLint *WXUNUSED(params))
|
||||
{
|
||||
}
|
||||
|
||||
void glLockArraysSGI(GLint WXUNUSED(first), GLsizei WXUNUSED(count))
|
||||
{
|
||||
}
|
||||
|
||||
void glUnlockArraysSGI()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void glCullParameterdvSGI(GLenum WXUNUSED(pname), GLdouble* WXUNUSED(params))
|
||||
{
|
||||
}
|
||||
|
||||
void glCullParameterfvSGI(GLenum WXUNUSED(pname), GLfloat* WXUNUSED(params))
|
||||
{
|
||||
}
|
||||
|
||||
void glIndexFuncSGI(GLenum WXUNUSED(func), GLclampf WXUNUSED(ref))
|
||||
{
|
||||
}
|
||||
|
||||
void glIndexMaterialSGI(GLenum WXUNUSED(face), GLenum WXUNUSED(mode))
|
||||
{
|
||||
}
|
||||
|
||||
void glAddSwapHintRectWin(GLint WXUNUSED(x), GLint WXUNUSED(y), GLsizei WXUNUSED(width), GLsizei WXUNUSED(height))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxGLApp
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(wxGLApp, wxApp)
|
||||
|
||||
bool wxGLApp::InitGLVisual(int *attribList)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxGLApp::~wxGLApp()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_GLCANVAS
|
||||
89
src/palmos/help.cpp
Normal file
89
src/palmos/help.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: helpwin.cpp
|
||||
// Purpose: Help system: WinHelp implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "helpwin.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_HELP
|
||||
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/msw/helpwin.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWinHelpController, wxHelpControllerBase)
|
||||
|
||||
bool wxWinHelpController::Initialize(const wxString& filename)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::LoadFile(const wxString& file)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplayContents(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplaySection(int section)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplayContextPopup(int contextId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::DisplayBlock(long block)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::KeywordSearch(const wxString& k,
|
||||
wxHelpSearchMode WXUNUSED(mode))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWinHelpController::Quit(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString wxWinHelpController::GetValidFilename(const wxString& file) const
|
||||
{
|
||||
wxString ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
97
src/palmos/icon.cpp
Normal file
97
src/palmos/icon.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/icon.cpp
|
||||
// Purpose: wxIcon class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "icon.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxGDIObject)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxIconRefData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxIconRefData::Free()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxIcon
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxIcon::wxIcon(const char bits[], int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
wxIcon::wxIcon(const wxString& iconfile,
|
||||
long flags,
|
||||
int desiredWidth,
|
||||
int desiredHeight)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
wxIcon::wxIcon(const wxIconLocation& loc)
|
||||
{
|
||||
}
|
||||
|
||||
wxIcon::~wxIcon()
|
||||
{
|
||||
}
|
||||
|
||||
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
|
||||
{
|
||||
}
|
||||
|
||||
void wxIcon::CreateIconFromXpm(const char **data)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxIcon::LoadFile(const wxString& filename,
|
||||
long type,
|
||||
int desiredWidth, int desiredHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
142
src/palmos/imaglist.cpp
Normal file
142
src/palmos/imaglist.cpp
Normal file
@@ -0,0 +1,142 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/imaglist.cpp
|
||||
// Purpose: wxImageList implementation for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "imaglist.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
|
||||
#include "wx/palmos/imaglist.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)
|
||||
|
||||
#define GetHImageList() ((HIMAGELIST)m_hImageList)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxImageList creation/destruction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxImageList::wxImageList()
|
||||
{
|
||||
}
|
||||
|
||||
// Creates an image list
|
||||
bool wxImageList::Create(int width, int height, bool mask, int initial)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxImageList::~wxImageList()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxImageList attributes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxImageList::GetImageCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxImageList::GetSize(int WXUNUSED(index), int &width, int &height) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxImageList operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxImageList::Add(const wxIcon& icon)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxImageList::Replace(int index,
|
||||
const wxBitmap& bitmap, const wxBitmap& mask)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxImageList::Replace(int i, const wxIcon& icon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxImageList::Remove(int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxImageList::RemoveAll()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxImageList::Draw(int index,
|
||||
wxDC& dc,
|
||||
int x, int y,
|
||||
int flags,
|
||||
bool solidBackground)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
220
src/palmos/iniconf.cpp
Normal file
220
src/palmos/iniconf.cpp
Normal file
@@ -0,0 +1,220 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/iniconf.cpp
|
||||
// Purpose: implementation of wxIniConfig class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "iniconf.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"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
// Doesn't yet compile in Unicode mode
|
||||
|
||||
#if wxUSE_CONFIG && !wxUSE_UNICODE
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/config.h"
|
||||
#include "wx/file.h"
|
||||
|
||||
#include "wx/palmos/iniconf.h"
|
||||
|
||||
#include "wx/palmos/wrapwin.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we replace all path separators with this character
|
||||
#define PATH_SEP_REPLACE '_'
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ctor & dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxIniConfig::wxIniConfig(const wxString& strAppName,
|
||||
const wxString& strVendor,
|
||||
const wxString& localFilename,
|
||||
const wxString& globalFilename,
|
||||
long style)
|
||||
: wxConfigBase(strAppName, strVendor, localFilename, globalFilename, style)
|
||||
{
|
||||
}
|
||||
|
||||
wxIniConfig::~wxIniConfig()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// path management
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxIniConfig::SetPath(const wxString& strPath)
|
||||
{
|
||||
}
|
||||
|
||||
const wxString& wxIniConfig::GetPath() const
|
||||
{
|
||||
static wxString s_str;
|
||||
|
||||
return s_str;
|
||||
}
|
||||
|
||||
wxString wxIniConfig::GetPrivateKeyName(const wxString& szKey) const
|
||||
{
|
||||
wxString strKey;
|
||||
|
||||
return strKey;
|
||||
}
|
||||
|
||||
wxString wxIniConfig::GetKeyName(const wxString& szKey) const
|
||||
{
|
||||
wxString strKey;
|
||||
|
||||
return strKey;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// enumeration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxIniConfig::GetFirstGroup(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::GetNextGroup (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::GetFirstEntry(wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::GetNextEntry (wxString& WXUNUSED(str), long& WXUNUSED(lIndex)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// misc info
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxIniConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
|
||||
{
|
||||
return (size_t)-1;
|
||||
}
|
||||
|
||||
size_t wxIniConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
|
||||
{
|
||||
return (size_t)-1;
|
||||
}
|
||||
|
||||
bool wxIniConfig::HasGroup(const wxString& WXUNUSED(strName)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::HasEntry(const wxString& WXUNUSED(strName)) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// is current group empty?
|
||||
bool wxIniConfig::IsEmpty() const
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// read/write
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const
|
||||
{
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::DoWriteLong(const wxString& szKey, long lValue)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::Flush(bool /* bCurrentOnly */)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// delete
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::DeleteGroup(const wxString& szKey)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 256
|
||||
#endif
|
||||
|
||||
bool wxIniConfig::DeleteAll()
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::RenameEntry(const wxString& WXUNUSED(oldName),
|
||||
const wxString& WXUNUSED(newName))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxIniConfig::RenameGroup(const wxString& WXUNUSED(oldName),
|
||||
const wxString& WXUNUSED(newName))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_CONFIG && wxUSE_UNICODE
|
||||
257
src/palmos/joystick.cpp
Normal file
257
src/palmos/joystick.cpp
Normal file
@@ -0,0 +1,257 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: joystick.cpp
|
||||
// Purpose: wxJoystick class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "joystick.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/string.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
#if !defined(__WIN32__) && !defined(_MMRESULT_)
|
||||
typedef UINT MMRESULT;
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/palmos/joystick.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxJoystick::wxJoystick(int joystick)
|
||||
{
|
||||
};
|
||||
|
||||
wxPoint wxJoystick::GetPosition() const
|
||||
{
|
||||
return wxPoint(0, 0);
|
||||
}
|
||||
|
||||
int wxJoystick::GetZPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetButtonState() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPOVPosition() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPOVCTSPosition() const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetUPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetVPosition() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetMovementThreshold() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxJoystick::SetMovementThreshold(int threshold)
|
||||
{
|
||||
}
|
||||
|
||||
// Capabilities
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int wxJoystick::GetNumberJoysticks()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxJoystick::IsOk() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxJoystick::GetManufacturerId() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetProductId() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxString wxJoystick::GetProductName() const
|
||||
{
|
||||
return wxString("");
|
||||
}
|
||||
|
||||
int wxJoystick::GetXMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetYMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetZMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetXMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetYMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetZMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetNumberButtons() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetNumberAxes() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetMaxButtons() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetMaxAxes() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPollingMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetPollingMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetRudderMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetUMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetUMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetVMin() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxJoystick::GetVMax() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool wxJoystick::HasRudder() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasZ() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasU() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasV() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOV() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOV4Dir() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::HasPOVCTS() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxJoystick::ReleaseCapture()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
324
src/palmos/listbox.cpp
Normal file
324
src/palmos/listbox.cpp
Normal file
@@ -0,0 +1,324 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/listbox.cpp
|
||||
// Purpose: wxListBox
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "listbox.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/listbox.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/utils.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#include "wx/ownerdrw.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxListBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxListBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxLB_SINGLE)
|
||||
wxFLAGS_MEMBER(wxLB_MULTIPLE)
|
||||
wxFLAGS_MEMBER(wxLB_EXTENDED)
|
||||
wxFLAGS_MEMBER(wxLB_HSCROLL)
|
||||
wxFLAGS_MEMBER(wxLB_ALWAYS_SB)
|
||||
wxFLAGS_MEMBER(wxLB_NEEDED_SB)
|
||||
wxFLAGS_MEMBER(wxLB_SORT)
|
||||
|
||||
wxEND_FLAGS( wxListBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxListBox, wxControl,"wx/listbox.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxListBox)
|
||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent )
|
||||
wxEVENT_PROPERTY( DoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent )
|
||||
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Selection ,int, SetSelection, GetSelection, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxListBox)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_4( wxListBox , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// list box item declaration and implementation
|
||||
// ============================================================================
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
|
||||
class wxListBoxItem : public wxOwnerDrawn
|
||||
{
|
||||
public:
|
||||
wxListBoxItem(const wxString& str = wxEmptyString);
|
||||
};
|
||||
|
||||
wxListBoxItem::wxListBoxItem(const wxString& str) : wxOwnerDrawn(str, FALSE)
|
||||
{
|
||||
// no bitmaps/checkmarks
|
||||
SetMarginWidth(0);
|
||||
}
|
||||
|
||||
wxOwnerDrawn *wxListBox::CreateLboxItem(size_t WXUNUSED(n))
|
||||
{
|
||||
return new wxListBoxItem();
|
||||
}
|
||||
|
||||
#endif //USE_OWNER_DRAWN
|
||||
|
||||
// ============================================================================
|
||||
// list box control implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Listbox item
|
||||
wxListBox::wxListBox()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxListBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n, const wxString choices[],
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxListBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxListBox::~wxListBox()
|
||||
{
|
||||
}
|
||||
|
||||
WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// implementation of wxListBoxBase methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::DoSetFirstItem(int N)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListBox::Delete(int N)
|
||||
{
|
||||
}
|
||||
|
||||
int wxListBox::DoAppend(const wxString& item)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
|
||||
{
|
||||
}
|
||||
|
||||
int wxListBox::FindString(const wxString& s) const
|
||||
{
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
void wxListBox::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
void wxListBox::Free()
|
||||
{
|
||||
}
|
||||
|
||||
void wxListBox::SetSelection(int N, bool select)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxListBox::IsSelected(int N) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxClientData* wxListBox::DoGetItemClientObject(int n) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void *wxListBox::DoGetItemClientData(int n) const
|
||||
{
|
||||
return (void *)NULL;
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListBox::DoSetItemClientData(int n, void *clientData)
|
||||
{
|
||||
}
|
||||
|
||||
// Return number of selections and an array of selected integers
|
||||
int wxListBox::GetSelections(wxArrayInt& aSelections) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get single selection, for single choice list items
|
||||
int wxListBox::GetSelection() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxListBox::GetString(int N) const
|
||||
{
|
||||
wxString result;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListBox::SetString(int N, const wxString& s)
|
||||
{
|
||||
}
|
||||
|
||||
int wxListBox::GetCount() const
|
||||
{
|
||||
return m_noItems;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helpers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListBox::SetHorizontalExtent(const wxString& s)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxListBox::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// callbacks
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckListBox support
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
|
||||
// drawing
|
||||
// -------
|
||||
|
||||
// space beneath/above each row in pixels
|
||||
// "standard" checklistbox use 1 here, some might prefer 2. 0 is ugly.
|
||||
#define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
|
||||
|
||||
// the height is the same for all items
|
||||
// TODO should be changed for LBS_OWNERDRAWVARIABLE style listboxes
|
||||
|
||||
// NB: can't forward this to wxListBoxItem because LB_SETITEMDATA
|
||||
// message is not yet sent when we get here!
|
||||
bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// forward the message to the appropriate item
|
||||
bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
#endif // wxUSE_LISTBOX
|
||||
741
src/palmos/listctrl.cpp
Normal file
741
src/palmos/listctrl.cpp
Normal file
@@ -0,0 +1,741 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/listctrl.cpp
|
||||
// Purpose: wxListCtrl
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "listctrl.h"
|
||||
#pragma implementation "listctrlbase.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL && defined(__WIN95__)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/palmos/wrapcctl.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private helper classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_GET_INFO)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_SET_INFO)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_INSERT_ITEM)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_CLICK)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_DRAGGING)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_END_DRAG)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT)
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxListCtrlStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxListCtrlStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxLC_LIST)
|
||||
wxFLAGS_MEMBER(wxLC_REPORT)
|
||||
wxFLAGS_MEMBER(wxLC_ICON)
|
||||
wxFLAGS_MEMBER(wxLC_SMALL_ICON)
|
||||
wxFLAGS_MEMBER(wxLC_ALIGN_TOP)
|
||||
wxFLAGS_MEMBER(wxLC_ALIGN_LEFT)
|
||||
wxFLAGS_MEMBER(wxLC_AUTOARRANGE)
|
||||
wxFLAGS_MEMBER(wxLC_USER_TEXT)
|
||||
wxFLAGS_MEMBER(wxLC_EDIT_LABELS)
|
||||
wxFLAGS_MEMBER(wxLC_NO_HEADER)
|
||||
wxFLAGS_MEMBER(wxLC_SINGLE_SEL)
|
||||
wxFLAGS_MEMBER(wxLC_SORT_ASCENDING)
|
||||
wxFLAGS_MEMBER(wxLC_SORT_DESCENDING)
|
||||
wxFLAGS_MEMBER(wxLC_VIRTUAL)
|
||||
|
||||
wxEND_FLAGS( wxListCtrlStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxListCtrl)
|
||||
wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
|
||||
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxListCtrl)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxListCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
|
||||
/*
|
||||
TODO : Expose more information of a list's layout etc. via appropriate objects (<28> la NotebookPageInfo)
|
||||
*/
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)
|
||||
#endif
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListView, wxListCtrl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxNotifyEvent)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
|
||||
EVT_PAINT(wxListCtrl::OnPaint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxListCtrl construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxListCtrl::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxListCtrl::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxListCtrl::UpdateStyle()
|
||||
{
|
||||
}
|
||||
|
||||
void wxListCtrl::FreeAllInternalData()
|
||||
{
|
||||
}
|
||||
|
||||
wxListCtrl::~wxListCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// set/get/change style
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Add or remove a single window style
|
||||
void wxListCtrl::SetSingleStyle(long style, bool add)
|
||||
{
|
||||
}
|
||||
|
||||
// Set the whole window style
|
||||
void wxListCtrl::SetWindowStyleFlag(long flag)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* static */ wxVisualAttributes
|
||||
wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
|
||||
{
|
||||
wxVisualAttributes attrs;
|
||||
|
||||
return attrs;
|
||||
}
|
||||
|
||||
// Sets the foreground, i.e. text, colour
|
||||
bool wxListCtrl::SetForegroundColour(const wxColour& col)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets the background colour
|
||||
bool wxListCtrl::SetBackgroundColour(const wxColour& col)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets information about this column
|
||||
bool wxListCtrl::GetColumn(int col, wxListItem& item) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets information about this column
|
||||
bool wxListCtrl::SetColumn(int col, wxListItem& item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets the column width
|
||||
int wxListCtrl::GetColumnWidth(int col) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Sets the column width
|
||||
bool wxListCtrl::SetColumnWidth(int col, int width)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets the number of items that can fit vertically in the
|
||||
// visible area of the list control (list or report view)
|
||||
// or the total number of items in the list control (icon
|
||||
// or small icon view)
|
||||
int wxListCtrl::GetCountPerPage() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Gets the edit control for editing labels.
|
||||
wxTextCtrl* wxListCtrl::GetEditControl() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Gets information about the item
|
||||
bool wxListCtrl::GetItem(wxListItem& info) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets information about the item
|
||||
bool wxListCtrl::SetItem(wxListItem& info)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
long wxListCtrl::SetItem(long index, int col, const wxString& label, int imageId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Gets the item state
|
||||
int wxListCtrl::GetItemState(long item, long stateMask) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Sets the item state
|
||||
bool wxListCtrl::SetItemState(long item, long state, long stateMask)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets the item image
|
||||
bool wxListCtrl::SetItemImage(long item, int image, int WXUNUSED(selImage))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets the item text
|
||||
wxString wxListCtrl::GetItemText(long item) const
|
||||
{
|
||||
wxListItem info;
|
||||
|
||||
return info.m_text;
|
||||
}
|
||||
|
||||
// Sets the item text
|
||||
void wxListCtrl::SetItemText(long item, const wxString& str)
|
||||
{
|
||||
}
|
||||
|
||||
// Gets the item data
|
||||
long wxListCtrl::GetItemData(long item) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Sets the item data
|
||||
bool wxListCtrl::SetItemData(long item, long data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxRect wxListCtrl::GetViewRect() const
|
||||
{
|
||||
wxRect rect;
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
// Gets the item rectangle
|
||||
bool wxListCtrl::GetItemRect(long item, wxRect& rect, int code) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets the item position
|
||||
bool wxListCtrl::GetItemPosition(long item, wxPoint& pos) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Sets the item position.
|
||||
bool wxListCtrl::SetItemPosition(long item, const wxPoint& pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Gets the number of items in the list control
|
||||
int wxListCtrl::GetItemCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxSize wxListCtrl::GetItemSpacing() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
int wxListCtrl::GetItemSpacing(bool isSmall) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxListCtrl::SetItemTextColour( long item, const wxColour &col )
|
||||
{
|
||||
}
|
||||
|
||||
wxColour wxListCtrl::GetItemTextColour( long item ) const
|
||||
{
|
||||
wxColour col;
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
void wxListCtrl::SetItemBackgroundColour( long item, const wxColour &col )
|
||||
{
|
||||
}
|
||||
|
||||
wxColour wxListCtrl::GetItemBackgroundColour( long item ) const
|
||||
{
|
||||
wxColour col;
|
||||
|
||||
return col;
|
||||
}
|
||||
|
||||
// Gets the number of selected items in the list control
|
||||
int wxListCtrl::GetSelectedItemCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Gets the text colour of the listview
|
||||
wxColour wxListCtrl::GetTextColour() const
|
||||
{
|
||||
wxColour col;
|
||||
return col;
|
||||
}
|
||||
|
||||
// Sets the text colour of the listview
|
||||
void wxListCtrl::SetTextColour(const wxColour& col)
|
||||
{
|
||||
}
|
||||
|
||||
// Gets the index of the topmost visible item when in
|
||||
// list or report view
|
||||
long wxListCtrl::GetTopItem() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Searches for an item, starting from 'item'.
|
||||
// 'geometry' is one of
|
||||
// wxLIST_NEXT_ABOVE/ALL/BELOW/LEFT/RIGHT.
|
||||
// 'state' is a state bit flag, one or more of
|
||||
// wxLIST_STATE_DROPHILITED/FOCUSED/SELECTED/CUT.
|
||||
// item can be -1 to find the first item that matches the
|
||||
// specified flags.
|
||||
// Returns the item or -1 if unsuccessful.
|
||||
long wxListCtrl::GetNextItem(long item, int geom, int state) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
wxImageList *wxListCtrl::GetImageList(int which) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxListCtrl::SetImageList(wxImageList *imageList, int which)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListCtrl::AssignImageList(wxImageList *imageList, int which)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Arranges the items
|
||||
bool wxListCtrl::Arrange(int flag)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deletes an item
|
||||
bool wxListCtrl::DeleteItem(long item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deletes all items
|
||||
bool wxListCtrl::DeleteAllItems()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deletes all items
|
||||
bool wxListCtrl::DeleteAllColumns()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Deletes a column
|
||||
bool wxListCtrl::DeleteColumn(int col)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clears items, and columns if there are any.
|
||||
void wxListCtrl::ClearAll()
|
||||
{
|
||||
}
|
||||
|
||||
wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// End label editing, optionally cancelling the edit
|
||||
bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Ensures this item is visible
|
||||
bool wxListCtrl::EnsureVisible(long item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find an item whose label matches this string, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long wxListCtrl::FindItem(long start, const wxString& str, bool partial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Find an item whose data matches this data, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
// NOTE : Lindsay Mathieson - 14-July-2002
|
||||
// No longer use ListView_FindItem as the data attribute is now stored
|
||||
// in a wxListItemInternalData structure refernced by the actual lParam
|
||||
long wxListCtrl::FindItem(long start, long data)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Find an item nearest this position in the specified direction, starting from
|
||||
// the item after 'start' or the beginning if 'start' is -1.
|
||||
long wxListCtrl::FindItem(long start, const wxPoint& pt, int direction)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
long wxListCtrl::HitTest(const wxPoint& point, int& flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Inserts an item, returning the index of the new item if successful,
|
||||
// -1 otherwise.
|
||||
long wxListCtrl::InsertItem(wxListItem& info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxListCtrl::InsertItem(long index, const wxString& label)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Inserts an image item
|
||||
long wxListCtrl::InsertItem(long index, int imageIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Inserts an image/string item
|
||||
long wxListCtrl::InsertItem(long index, const wxString& label, int imageIndex)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// For list view mode (only), inserts a column.
|
||||
long wxListCtrl::InsertColumn(long col, wxListItem& item)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
long wxListCtrl::InsertColumn(long col,
|
||||
const wxString& heading,
|
||||
int format,
|
||||
int width)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// scroll the control by the given number of pixels (exception: in list view,
|
||||
// dx is interpreted as number of columns)
|
||||
bool wxListCtrl::ScrollList(int dx, int dy)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Sort items.
|
||||
|
||||
// fn is a function which takes 3 long arguments: item1, item2, data.
|
||||
// item1 is the long data associated with a first item (NOT the index).
|
||||
// item2 is the long data associated with a second item (NOT the index).
|
||||
// data is the same value as passed to SortItems.
|
||||
// The return value is a negative number if the first item should precede the second
|
||||
// item, a positive number of the second item should precede the first,
|
||||
// or zero if the two items are equivalent.
|
||||
|
||||
// data is arbitrary data to be passed to the sort function.
|
||||
|
||||
// Internal structures for proxying the user compare function
|
||||
// so that we can pass it the *real* user data
|
||||
|
||||
// translate lParam data and call user func
|
||||
struct wxInternalDataSort
|
||||
{
|
||||
wxListCtrlCompare user_fn;
|
||||
long data;
|
||||
};
|
||||
|
||||
int CALLBACK wxInternalDataCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
|
||||
{
|
||||
struct wxInternalDataSort *internalData = (struct wxInternalDataSort *) lParamSort;
|
||||
|
||||
wxListItemInternalData *data1 = (wxListItemInternalData *) lParam1;
|
||||
wxListItemInternalData *data2 = (wxListItemInternalData *) lParam2;
|
||||
|
||||
long d1 = (data1 == NULL ? 0 : data1->lParam);
|
||||
long d2 = (data2 == NULL ? 0 : data2->lParam);
|
||||
|
||||
return internalData->user_fn(d1, d2, internalData->data);
|
||||
|
||||
};
|
||||
|
||||
bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// message processing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// see comment at the end of wxListCtrl::GetColumn()
|
||||
#ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300
|
||||
|
||||
WXLPARAM wxListCtrl::OnCustomDraw(WXLPARAM lParam)
|
||||
{
|
||||
return CDRF_DODEFAULT;
|
||||
}
|
||||
|
||||
#endif // NM_CUSTOMDRAW supported
|
||||
|
||||
// Necessary for drawing hrules and vrules, if specified
|
||||
void wxListCtrl::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// virtual list controls
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const
|
||||
{
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const
|
||||
{
|
||||
// no attributes by default
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxListCtrl::SetItemCount(long count)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListCtrl::RefreshItem(long item)
|
||||
{
|
||||
}
|
||||
|
||||
void wxListCtrl::RefreshItems(long itemFrom, long itemTo)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// internal data stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static wxListItemInternalData *wxGetInternalData(HWND hwnd, long itemId)
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
|
||||
static
|
||||
wxListItemInternalData *wxGetInternalData(const wxListCtrl *ctl, long itemId)
|
||||
{
|
||||
return wxGetInternalData(GetHwndOf(ctl), itemId);
|
||||
};
|
||||
|
||||
static wxListItemAttr *wxGetInternalDataAttr(wxListCtrl *ctl, long itemId)
|
||||
{
|
||||
return NULL;
|
||||
};
|
||||
|
||||
static void wxDeleteInternalData(wxListCtrl* ctl, long itemId)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin <-> MSW items conversions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static void wxConvertFromMSWListItem(HWND hwndListCtrl,
|
||||
wxListItem& info,
|
||||
LV_ITEM& lvItem)
|
||||
{
|
||||
}
|
||||
|
||||
static void wxConvertToMSWFlags(long state, long stateMask, LV_ITEM& lvItem)
|
||||
{
|
||||
}
|
||||
|
||||
static void wxConvertToMSWListItem(const wxListCtrl *ctrl,
|
||||
const wxListItem& info,
|
||||
LV_ITEM& lvItem)
|
||||
{
|
||||
}
|
||||
|
||||
static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item,
|
||||
LV_COLUMN& lvCol)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_LISTCTRL
|
||||
|
||||
66
src/palmos/main.cpp
Normal file
66
src/palmos/main.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/main.cpp
|
||||
// Purpose: wxEnter for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/07/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/cmdline.h"
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
// ============================================================================
|
||||
// implementation: various entry points
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Platform-specific wxEntry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxEntry()
|
||||
{
|
||||
/* There is no command line in PalmOS. For now generate a fake arument
|
||||
* list. Later this may be changed to reflect the application launch code
|
||||
*/
|
||||
wxArrayString args;
|
||||
int argc = args.GetCount();
|
||||
|
||||
// +1 here for the terminating NULL
|
||||
wxChar **argv = new wxChar *[argc + 1];
|
||||
for ( int i = 0; i < argc; i++ )
|
||||
{
|
||||
argv[i] = wxStrdup(args[i]);
|
||||
}
|
||||
|
||||
// argv[] must be NULL-terminated
|
||||
argv[argc] = NULL;
|
||||
|
||||
return wxEntry(argc, argv);
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
441
src/palmos/mdi.cpp
Normal file
441
src/palmos/mdi.cpp
Normal file
@@ -0,0 +1,441 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/mdi.cpp
|
||||
// Purpose: MDI classes for wx
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "mdi.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_MDI && !defined(__WXUNIVERSAL__)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/setup.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#if wxUSE_STATUSBAR
|
||||
#include "wx/statusbr.h"
|
||||
#endif
|
||||
#include "wx/settings.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/mdi.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR
|
||||
#include "wx/palmos/statbr95.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
#include "wx/toolbar.h"
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
|
||||
extern const wxChar *wxMDIFrameClassName; // from app.cpp
|
||||
extern const wxChar *wxMDIChildFrameClassName;
|
||||
extern const wxChar *wxMDIChildFrameClassNameNoRedraw;
|
||||
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win);
|
||||
extern void wxRemoveHandleAssociation(wxWindow *win);
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static const int IDM_WINDOWTILE = 4001;
|
||||
static const int IDM_WINDOWTILEHOR = 4001;
|
||||
static const int IDM_WINDOWCASCADE = 4002;
|
||||
static const int IDM_WINDOWICONS = 4003;
|
||||
static const int IDM_WINDOWNEXT = 4004;
|
||||
static const int IDM_WINDOWTILEVERT = 4005;
|
||||
static const int IDM_WINDOWPREV = 4006;
|
||||
|
||||
// This range gives a maximum of 500 MDI children. Should be enough :-)
|
||||
static const int wxFIRST_MDI_CHILD = 4100;
|
||||
static const int wxLAST_MDI_CHILD = 4600;
|
||||
|
||||
// Status border dimensions
|
||||
static const int wxTHICK_LINE_BORDER = 3;
|
||||
static const int wxTHICK_LINE_WIDTH = 1;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// set the MDI menus (by sending the WM_MDISETMENU message) and update the menu
|
||||
// of the parent of win (which is supposed to be the MDI client window)
|
||||
static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow);
|
||||
|
||||
// insert the window menu (subMenu) into menu just before "Help" submenu or at
|
||||
// the very end if not found
|
||||
static void InsertWindowMenu(wxWindow *win, WXHMENU menu, HMENU subMenu);
|
||||
|
||||
// Remove the window menu
|
||||
static void RemoveWindowMenu(wxWindow *win, WXHMENU menu);
|
||||
|
||||
// is this an id of an MDI child?
|
||||
inline bool IsMdiCommandId(int id)
|
||||
{
|
||||
return (id >= wxFIRST_MDI_CHILD) && (id <= wxLAST_MDI_CHILD);
|
||||
}
|
||||
|
||||
// unpack the parameters of WM_MDIACTIVATE message
|
||||
static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *activate, WXHWND *hwndAct, WXHWND *hwndDeact);
|
||||
|
||||
// return the HMENU of the MDI menu
|
||||
static inline HMENU GetMDIWindowMenu(wxMDIParentFrame *frame)
|
||||
{
|
||||
wxMenu *menu = frame->GetWindowMenu();
|
||||
return menu ? GetHmenuOf(menu) : 0;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
||||
EVT_SIZE(wxMDIParentFrame::OnSize)
|
||||
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
|
||||
EVT_IDLE(wxMDIChildFrame::OnIdle)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow)
|
||||
EVT_SCROLL(wxMDIClientWindow::OnScroll)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ===========================================================================
|
||||
// wxMDIParentFrame: the frame which contains the client window which manages
|
||||
// the children
|
||||
// ===========================================================================
|
||||
|
||||
wxMDIParentFrame::wxMDIParentFrame()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxMDIParentFrame::~wxMDIParentFrame()
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
|
||||
void wxMDIParentFrame::InternalSetMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
void wxMDIParentFrame::SetWindowMenu(wxMenu* menu)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::OnSize(wxSizeEvent&)
|
||||
{
|
||||
}
|
||||
|
||||
// Returns the active MDI child window
|
||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Create the client window class (don't Create the window, just return a new
|
||||
// class)
|
||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||
{
|
||||
return new wxMDIClientWindow;
|
||||
}
|
||||
|
||||
// Responds to colour changes, and passes event on to children.
|
||||
void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
WXHICON wxMDIParentFrame::GetDefaultIcon() const
|
||||
{
|
||||
// we don't have any standard icons (any more)
|
||||
return (WXHICON)0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MDI operations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMDIParentFrame::Cascade()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::Tile()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ArrangeIcons()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivateNext()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIParentFrame::ActivatePrevious()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// the MDI parent frame window proc
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxMDIParentFrame::MSWWindowProc(WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxMDIParentFrame::HandleActivate(int state, bool minimized, WXHWND activate)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXLRESULT wxMDIParentFrame::MSWDefWindowProc(WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxMDIParentFrame::MSWTranslateMessage(WXMSG* msg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// wxMDIChildFrame
|
||||
// ===========================================================================
|
||||
|
||||
void wxMDIChildFrame::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxMDIChildFrame::~wxMDIChildFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// Set the client size (i.e. leave the calculation of borders etc.
|
||||
// to wxWidgets)
|
||||
void wxMDIChildFrame::DoSetClientSize(int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::DoGetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::InternalSetMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
WXHICON wxMDIChildFrame::GetDefaultIcon() const
|
||||
{
|
||||
// we don't have any standard icons (any more)
|
||||
return (WXHICON)0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MDI operations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMDIChildFrame::Maximize(bool maximize)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::Restore()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::Activate()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MDI window proc and message handlers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxMDIChildFrame::MSWWindowProc(WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
|
||||
WXHWND hwndAct,
|
||||
WXHWND hwndDeact)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::HandleWindowPosChanging(void *pos)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::HandleGetMinMaxInfo(void *mmInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// MDI specific message translation/preprocessing
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxMDIChildFrame::MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// misc
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMDIChildFrame::MSWDestroyWindow()
|
||||
{
|
||||
}
|
||||
|
||||
// Change the client window's extended style so we don't get a client edge
|
||||
// style when a child is maximised (a double border looks silly.)
|
||||
bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// wxMDIClientWindow: the window of predefined (by Windows) class which
|
||||
// contains the child frames
|
||||
// ===========================================================================
|
||||
|
||||
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxMDIClientWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// non member functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow)
|
||||
{
|
||||
}
|
||||
|
||||
static void InsertWindowMenu(wxWindow *win, WXHMENU menu, HMENU subMenu)
|
||||
{
|
||||
}
|
||||
|
||||
static void RemoveWindowMenu(wxWindow *win, WXHMENU menu)
|
||||
{
|
||||
}
|
||||
|
||||
static void UnpackMDIActivate(WXWPARAM wParam, WXLPARAM lParam,
|
||||
WXWORD *activate, WXHWND *hwndAct, WXHWND *hwndDeact)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_MDI && !defined(__WXUNIVERSAL__)
|
||||
|
||||
677
src/palmos/menu.cpp
Normal file
677
src/palmos/menu.cpp
Normal file
@@ -0,0 +1,677 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menu.cpp
|
||||
// Purpose: wxMenu, wxMenuBar, wxMenuItem
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/12/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "menu.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/frame.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#include "wx/ownerdrw.h"
|
||||
#endif
|
||||
|
||||
// other standard headers
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __PALMOS__
|
||||
#include <PalmOS.h>
|
||||
#include <Menu.h>
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern wxMenu *wxCurrentPopupMenu;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the (popup) menu title has this special id
|
||||
static const int idMenuTitle = -3;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
#include <wx/listimpl.cpp>
|
||||
|
||||
WX_DEFINE_LIST( wxMenuInfoList ) ;
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
WX_DEFINE_FLAGS( wxMenuStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxMenuStyle )
|
||||
wxFLAGS_MEMBER(wxMENU_TEAROFF)
|
||||
wxEND_FLAGS( wxMenuStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxMenu, wxEvtHandler,"wx/menu.h")
|
||||
|
||||
wxCOLLECTION_TYPE_INFO( wxMenuItem * , wxMenuItemList ) ;
|
||||
|
||||
template<> void wxCollectionToVariantArray( wxMenuItemList const &theList, wxxVariantArray &value)
|
||||
{
|
||||
wxListCollectionToVariantArray<wxMenuItemList::compatibility_iterator>( theList , value ) ;
|
||||
}
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxMenu)
|
||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_MENU_SELECTED , wxCommandEvent)
|
||||
wxPROPERTY( Title, wxString , SetTitle, GetTitle, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxREADONLY_PROPERTY_FLAGS( MenuStyle , wxMenuStyle , long , GetStyle , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxPROPERTY_COLLECTION( MenuItems , wxMenuItemList , wxMenuItem* , Append , GetMenuItems , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxMenu)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxDIRECT_CONSTRUCTOR_2( wxMenu , wxString , Title , long , MenuStyle )
|
||||
|
||||
WX_DEFINE_FLAGS( wxMenuBarStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxMenuBarStyle )
|
||||
wxFLAGS_MEMBER(wxMB_DOCKABLE)
|
||||
wxEND_FLAGS( wxMenuBarStyle )
|
||||
|
||||
// the negative id would lead the window (its superclass !) to vetoe streaming out otherwise
|
||||
bool wxMenuBarStreamingCallback( const wxObject *WXUNUSED(object), wxWriter * , wxPersister * , wxxVariantArray & )
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuBar, wxWindow ,"wx/menu.h",wxMenuBarStreamingCallback)
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxMenuInfo, wxObject , "wx/menu.h" )
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxMenuInfo)
|
||||
wxREADONLY_PROPERTY( Menu , wxMenu* , GetMenu , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxREADONLY_PROPERTY( Title , wxString , GetTitle , wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxMenuInfo)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_2( wxMenuInfo , wxMenu* , Menu , wxString , Title )
|
||||
|
||||
wxCOLLECTION_TYPE_INFO( wxMenuInfo * , wxMenuInfoList ) ;
|
||||
|
||||
template<> void wxCollectionToVariantArray( wxMenuInfoList const &theList, wxxVariantArray &value)
|
||||
{
|
||||
wxListCollectionToVariantArray<wxMenuInfoList::compatibility_iterator>( theList , value ) ;
|
||||
}
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxMenuBar)
|
||||
wxPROPERTY_COLLECTION( MenuInfos , wxMenuInfoList , wxMenuInfo* , Append , GetMenuInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxMenuBar)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_DUMMY( wxMenuBar )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuInfo, wxObject)
|
||||
#endif
|
||||
|
||||
const wxMenuInfoList& wxMenuBar::GetMenuInfos() const
|
||||
{
|
||||
wxMenuInfoList* list = const_cast< wxMenuInfoList* >( &m_menuInfos ) ;
|
||||
WX_CLEAR_LIST( wxMenuInfoList , *list ) ;
|
||||
for( size_t i = 0 ; i < GetMenuCount() ; ++i )
|
||||
{
|
||||
wxMenuInfo* info = new wxMenuInfo() ;
|
||||
info->Create( const_cast<wxMenuBar*>(this)->GetMenu(i) , GetLabelTop(i) ) ;
|
||||
list->Append( info ) ;
|
||||
}
|
||||
return m_menuInfos ;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMenu construction, adding and removing menu items
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Construct a menu with optional title (then use append)
|
||||
void wxMenu::Init()
|
||||
{
|
||||
}
|
||||
|
||||
// The wxWindow destructor will take care of deleting the submenus.
|
||||
wxMenu::~wxMenu()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenu::Break()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenu::Attach(wxMenuBarBase *menubar)
|
||||
{
|
||||
wxMenuBase::Attach(menubar);
|
||||
}
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
int wxMenu::FindAccel(int id) const
|
||||
{
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
void wxMenu::UpdateAccel(wxMenuItem *item)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// append a new item or submenu to the menu
|
||||
bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
|
||||
{
|
||||
if ( IsAttached() && GetMenuBar()->IsAttached() )
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxMenu::EndRadioGroup()
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
|
||||
{
|
||||
wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") );
|
||||
|
||||
if(!wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else if(IsAttached() && GetMenuBar()->IsAttached())
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
wxMenuItem* wxMenu::DoInsert(size_t pos, wxMenuItem *item)
|
||||
{
|
||||
if (wxMenuBase::DoInsert(pos, item) && DoInsertOrAppend(item, pos))
|
||||
return item;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxMenuItem *wxMenu::DoRemove(wxMenuItem *item)
|
||||
{
|
||||
// we need to find the items position in the child list
|
||||
size_t pos;
|
||||
wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
|
||||
for ( pos = 0; node; pos++ )
|
||||
{
|
||||
if ( node->GetData() == item )
|
||||
break;
|
||||
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
// DoRemove() (unlike Remove) can only be called for existing item!
|
||||
wxCHECK_MSG( node, NULL, wxT("bug in wxMenu::Remove logic") );
|
||||
|
||||
// remove the item from the menu
|
||||
wxMenuItem *ret=wxMenuBase::DoRemove(item);
|
||||
|
||||
if ( IsAttached() && GetMenuBar()->IsAttached() )
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// accelerator helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
// create the wxAcceleratorEntries for our accels and put them into provided
|
||||
// array - return the number of accels we have
|
||||
size_t wxMenu::CopyAccels(wxAcceleratorEntry *accels) const
|
||||
{
|
||||
size_t count = GetAccelCount();
|
||||
for ( size_t n = 0; n < count; n++ )
|
||||
{
|
||||
*accels++ = *m_accels[n];
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// set wxMenu title
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMenu::SetTitle(const wxString& label)
|
||||
{
|
||||
m_title = label;
|
||||
|
||||
if ( IsAttached() && GetMenuBar()->IsAttached() )
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
GetMenuBar()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// event processing
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
bool wxMenu::PalmCommand(WXUINT WXUNUSED(param), WXWORD id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// other
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxWindow *wxMenu::GetWindow() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Menu Bar
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMenuBar::Init()
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuBar::wxMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuBar::wxMenuBar( long WXUNUSED(style) )
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[])
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuBar::~wxMenuBar()
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMenuBar helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMenuBar::Refresh()
|
||||
{
|
||||
wxCHECK_RET( IsAttached(), wxT("can't refresh unattached menubar") );
|
||||
|
||||
// Regenerate the menu resource
|
||||
LoadMenu();
|
||||
}
|
||||
|
||||
WXHMENU wxMenuBar::Create()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int wxMenuBar::PalmPositionForWxMenu(wxMenu *menu, int wxpos)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMenuBar functions to work with the top level submenus
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxMenuBar::EnableTop(size_t pos, bool enable)
|
||||
{
|
||||
// Palm OS does not have support for grayed or disabled items
|
||||
}
|
||||
|
||||
void wxMenuBar::SetLabelTop(size_t pos, const wxString& label)
|
||||
{
|
||||
wxCHECK_RET( pos < GetMenuCount(), wxT("invalid menu index") );
|
||||
|
||||
m_titles[pos]=wxStripMenuCodes(label);
|
||||
|
||||
if ( !IsAttached() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Regenerate the menu resource
|
||||
Refresh();
|
||||
}
|
||||
|
||||
wxString wxMenuBar::GetLabelTop(size_t pos) const
|
||||
{
|
||||
wxCHECK_MSG( pos < GetMenuCount(), wxEmptyString,
|
||||
wxT("invalid menu index in wxMenuBar::GetLabelTop") );
|
||||
|
||||
return wxMenuItem::GetLabelFromText(m_titles[pos]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxMenuBar construction
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
|
||||
{
|
||||
wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title);
|
||||
if ( !menuOld )
|
||||
return NULL;
|
||||
|
||||
m_titles[pos]=wxStripMenuCodes(title);
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
Refresh();
|
||||
}
|
||||
|
||||
return menuOld;
|
||||
}
|
||||
|
||||
bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title)
|
||||
{
|
||||
if ( !wxMenuBarBase::Insert(pos, menu, title) )
|
||||
return FALSE;
|
||||
|
||||
m_titles.Insert(wxStripMenuCodes(title), pos);
|
||||
|
||||
if ( IsAttached() )
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
Refresh();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxMenuBar::Append(wxMenu *menu, const wxString& title)
|
||||
{
|
||||
if ( !wxMenuBarBase::Append(menu, title) )
|
||||
return FALSE;
|
||||
|
||||
m_titles.Add(wxStripMenuCodes(title));
|
||||
|
||||
if(IsAttached())
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
Refresh();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxMenu *wxMenuBar::Remove(size_t pos)
|
||||
{
|
||||
wxMenu *menu = wxMenuBarBase::Remove(pos);
|
||||
if ( !menu )
|
||||
return NULL;
|
||||
|
||||
m_titles.RemoveAt(pos);
|
||||
|
||||
if (IsAttached())
|
||||
{
|
||||
// Regenerate the menu resource
|
||||
Refresh();
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
void wxMenuBar::RebuildAccelTable()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
int wxMenuBar::ProcessCommand(int ItemID)
|
||||
{
|
||||
if(!IsAttached())
|
||||
return -1;
|
||||
|
||||
int MenuNum=(ItemID/1000)-1;
|
||||
int ItemNum=(ItemID-(1000*(MenuNum+1)));
|
||||
|
||||
// Should never happen, but it doesn't hurt to check anyway.
|
||||
if(MenuNum>GetMenuCount())
|
||||
return -1;
|
||||
|
||||
// Get the menu
|
||||
wxMenu *ActiveMenu=GetMenu(MenuNum);
|
||||
|
||||
// Make sure this is a valid item.
|
||||
if(ItemNum>ActiveMenu->GetMenuItemCount())
|
||||
return -1;
|
||||
|
||||
// Get the item
|
||||
wxMenuItem *ActiveItem=ActiveMenu->FindItemByPosition(ItemNum);
|
||||
int ActiveID=ActiveItem->GetId();
|
||||
|
||||
return ActiveID;
|
||||
}
|
||||
|
||||
/* Palm OS does not have good dynamic menu support. About all you can do with
|
||||
* the standard API calls is to add new items to an existing drop-down menu and
|
||||
* hide/show items in a drop-down menu. It is impossible to add, hide, or
|
||||
* change the label on a drop-down menu.
|
||||
*
|
||||
* The easiest and simplest way around this limitation is to modify the Palm OS
|
||||
* MenuBarType structure directly. This gives limited ability to change the
|
||||
* label on a drop-down menu. I have not been able to find a safe way to add,
|
||||
* delete, or resize drop-down menus in OS 6.
|
||||
*
|
||||
* The following routine attempt to work around these limitations present in the
|
||||
* Palm OS API to provide limited dynamic menu support. This solution is far
|
||||
* from perfect, but the only other option is to wait for PalmSource to add full
|
||||
* dynamic menu support, or to recreate the Palm OS menu system from scratch.
|
||||
*
|
||||
* This system is limited in that no more than 4 drop-down menus are allowed per
|
||||
* menu bar, and the label for each drop-down menu is limited to 8 characters of
|
||||
* text. However, this menu system should work for most applications.
|
||||
*
|
||||
* Basically the menu routines select one of four menu bars, depending on
|
||||
* whether or not the requested menu bar has one, two, three, or four drop-down
|
||||
* menus.
|
||||
*
|
||||
* These four "template" menu bars contain one, two, three, or four drop-down
|
||||
* menus. Each menu has a dummy menu item attached to it to allow the Palm OS
|
||||
* MenuAddItem function to add the real items.
|
||||
*
|
||||
* The labels on the drop-down menus are then replaced with the labels of the
|
||||
* real menus.
|
||||
*
|
||||
* The menu is then attached to the active window and the MenuAddItem API
|
||||
* function is called to add the items to each drop-down menu. Finally,
|
||||
* MenuHideItem is called to remove the dummy items from each drop-down menu.
|
||||
*/
|
||||
void wxMenuBar::LoadMenu()
|
||||
{
|
||||
int i=0;
|
||||
int j=0;
|
||||
|
||||
// Handle to the currently running application database
|
||||
DmOpenRef AppDB;
|
||||
|
||||
// Get app database reference - needed for some Palm OS Menu API calls.
|
||||
SysGetModuleDatabase(SysGetRefNum(), NULL, &AppDB);
|
||||
|
||||
// Get the number of menus
|
||||
int NumMenus=GetMenuCount();
|
||||
|
||||
// Set up the pointers and handles
|
||||
char *PalmOSMenuBarPtr;
|
||||
MemHandle PalmOSMenuBar;
|
||||
|
||||
// Load the menu template and set up the menu pointers
|
||||
if(NumMenus==1)
|
||||
{
|
||||
PalmOSMenuBar=DmGetResource(AppDB,'MBAR',1000);
|
||||
PalmOSMenuBarPtr=(char *)MemHandleLock(PalmOSMenuBar);
|
||||
|
||||
PalmOSMenuBarPtr+=74;
|
||||
}
|
||||
else if(NumMenus==2)
|
||||
{
|
||||
PalmOSMenuBar=DmGetResource(AppDB,'MBAR',2000);
|
||||
PalmOSMenuBarPtr=(char *)MemHandleLock(PalmOSMenuBar);
|
||||
|
||||
PalmOSMenuBarPtr+=116;
|
||||
}
|
||||
else if(NumMenus==3)
|
||||
{
|
||||
PalmOSMenuBar=DmGetResource(AppDB,'MBAR',3000);
|
||||
PalmOSMenuBarPtr=(char *)MemHandleLock(PalmOSMenuBar);
|
||||
|
||||
PalmOSMenuBarPtr+=158;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We support a maximum of 4 menus, so make sure that do not create
|
||||
// more than we can handle.
|
||||
NumMenus=4;
|
||||
|
||||
PalmOSMenuBar=DmGetResource(AppDB,'MBAR',4000);
|
||||
PalmOSMenuBarPtr=(char *)MemHandleLock(PalmOSMenuBar);
|
||||
|
||||
PalmOSMenuBarPtr+=200;
|
||||
}
|
||||
|
||||
// Set the proper names for the drop-down triggers.
|
||||
for(i=0;i<NumMenus;i++)
|
||||
{
|
||||
// Clear out the old label
|
||||
char buffer[8]={' ',' ',' ',' ',' ',' ',' ',' '};
|
||||
MemMove(PalmOSMenuBarPtr,buffer,8);
|
||||
|
||||
wxString MenuTitle=m_titles.Item(i);
|
||||
|
||||
// Make sure we don't copy more than 8 bytes for the label
|
||||
int LengthToCopy=MenuTitle.length();
|
||||
if(LengthToCopy>8)
|
||||
LengthToCopy=8;
|
||||
|
||||
MemMove(PalmOSMenuBarPtr,MenuTitle,LengthToCopy);
|
||||
PalmOSMenuBarPtr+=11;
|
||||
}
|
||||
|
||||
// We are done with the menu pointer.
|
||||
MemHandleUnlock(PalmOSMenuBar);
|
||||
DmReleaseResource(PalmOSMenuBar);
|
||||
|
||||
// We must make the menu active before we can add items to the drop-down
|
||||
// triggers.
|
||||
FrmSetMenu(FrmGetActiveForm(),AppDB,NumMenus*1000);
|
||||
|
||||
/* Add the menu items to the drop-down triggers. This must be done after
|
||||
* setting the triggers, because setting the names of drop-down triggers
|
||||
* that have a variable number of items requires carefull calculation of
|
||||
* the offsets in the MenuBarType structure. Setting the triggers first
|
||||
* avoids this.
|
||||
*/
|
||||
for(i=0;i<NumMenus;i++)
|
||||
{
|
||||
wxMenu *CurrentMenu=GetMenu(i);
|
||||
|
||||
for(j=0;j<CurrentMenu->GetMenuItemCount();j++)
|
||||
{
|
||||
wxMenuItem *CurrentItem=CurrentMenu->FindItemByPosition(j);
|
||||
wxString ItemLabel=CurrentItem->GetLabel();
|
||||
|
||||
if(CurrentItem->IsSeparator()==true)
|
||||
{
|
||||
char Separator=MenuSeparatorChar;
|
||||
if(j==0)
|
||||
MenuAddItem(9000+i,((i*1000)+1000)+j,0x00,&Separator);
|
||||
else
|
||||
MenuAddItem(((i*1000)+1000)+j-1,((i*1000)+1000)+j,0x00,&Separator);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(j==0)
|
||||
MenuAddItem(9000+i,((i*1000)+1000)+j,0x00,ItemLabel);
|
||||
else
|
||||
MenuAddItem(((i*1000)+1000)+j-1,((i*1000)+1000)+j,0x00,ItemLabel);
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the dummy menu item, since we don't need it anymore.
|
||||
MenuHideItem(9000+i);
|
||||
}
|
||||
}
|
||||
|
||||
void wxMenuBar::Attach(wxFrame *frame)
|
||||
{
|
||||
wxMenuBarBase::Attach(frame);
|
||||
|
||||
LoadMenu();
|
||||
}
|
||||
|
||||
#if defined(__WXWINCE__) && (_WIN32_WCE >= 400 && !defined(__POCKETPC__) && !defined(__SMARTPHONE__))
|
||||
bool wxMenuBar::AddAdornments(long style)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxMenuBar::Detach()
|
||||
{
|
||||
wxMenuBarBase::Detach();
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
226
src/palmos/menuitem.cpp
Normal file
226
src/palmos/menuitem.cpp
Normal file
@@ -0,0 +1,226 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menuitem.cpp
|
||||
// Purpose: wxMenuItem implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "menuitem.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/font.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/accel.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/string.h"
|
||||
#endif
|
||||
|
||||
#include "wx/menuitem.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
#include "wx/accel.h"
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macro
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// conditional compilation
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
#define OWNER_DRAWN_ONLY( code ) if ( IsOwnerDrawn() ) code
|
||||
#else // !wxUSE_OWNER_DRAWN
|
||||
#define OWNER_DRAWN_ONLY( code )
|
||||
#endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// dynamic classes implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
|
||||
bool wxMenuItemStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
|
||||
{
|
||||
const wxMenuItem * mitem = dynamic_cast<const wxMenuItem*>(object) ;
|
||||
if ( mitem->GetMenu() && !mitem->GetMenu()->GetTitle().IsEmpty() )
|
||||
{
|
||||
// we don't stream out the first two items for menus with a title, they will be reconstructed
|
||||
if ( mitem->GetMenu()->FindItemByPosition(0) == mitem || mitem->GetMenu()->FindItemByPosition(1) == mitem )
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
wxBEGIN_ENUM( wxItemKind )
|
||||
wxENUM_MEMBER( wxITEM_SEPARATOR )
|
||||
wxENUM_MEMBER( wxITEM_NORMAL )
|
||||
wxENUM_MEMBER( wxITEM_CHECK )
|
||||
wxENUM_MEMBER( wxITEM_RADIO )
|
||||
wxEND_ENUM( wxItemKind )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxMenuItem, wxObject,"wx/menuitem.h",wxMenuItemStreamingCallback)
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxMenuItem)
|
||||
wxPROPERTY( Parent,wxMenu*, SetMenu, GetMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Id,int, SetId, GetId, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Text, wxString , SetText, GetText, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Help, wxString , SetHelp, GetHelp, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxREADONLY_PROPERTY( Kind, wxItemKind , GetKind , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( SubMenu,wxMenu*, SetSubMenu, GetSubMenu, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Checked , bool , Check , IsChecked , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Checkable , bool , SetCheckable , IsCheckable , wxxVariant((bool)false) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxMenuItem)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxDIRECT_CONSTRUCTOR_6( wxMenuItem , wxMenu* , Parent , int , Id , wxString , Text , wxString , Help , wxItemKind , Kind , wxMenu* , SubMenu )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuItem
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ctor & dtor
|
||||
// -----------
|
||||
|
||||
wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& strHelp,
|
||||
wxItemKind kind,
|
||||
wxMenu *pSubMenu)
|
||||
: wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu)
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
, wxOwnerDrawn(text, kind == wxITEM_CHECK, true)
|
||||
#endif // owner drawn
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuItem::wxMenuItem(wxMenu *parentMenu,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help,
|
||||
bool isCheckable,
|
||||
wxMenu *subMenu)
|
||||
: wxMenuItemBase(parentMenu, id, text, help,
|
||||
isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu)
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
, wxOwnerDrawn(text, isCheckable, true)
|
||||
#endif // owner drawn
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::Init()
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuItem::~wxMenuItem()
|
||||
{
|
||||
}
|
||||
|
||||
// misc
|
||||
// ----
|
||||
|
||||
// return the id for calling Win32 API functions
|
||||
int wxMenuItem::GetRealId() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// get item state
|
||||
// --------------
|
||||
|
||||
bool wxMenuItem::IsChecked() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
||||
{
|
||||
return wxStripMenuCodes(text);
|
||||
}
|
||||
|
||||
// radio group stuff
|
||||
// -----------------
|
||||
|
||||
void wxMenuItem::SetAsRadioGroupStart()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::SetRadioGroupStart(int start)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::SetRadioGroupEnd(int end)
|
||||
{
|
||||
}
|
||||
|
||||
// change item state
|
||||
// -----------------
|
||||
|
||||
void wxMenuItem::Enable(bool enable)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::Check(bool check)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::SetText(const wxString& text)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMenuItem::SetCheckable(bool checkable)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuItemBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
||||
int id,
|
||||
const wxString& name,
|
||||
const wxString& help,
|
||||
wxItemKind kind,
|
||||
wxMenu *subMenu)
|
||||
{
|
||||
return new wxMenuItem(parentMenu, id, name, help, kind, subMenu);
|
||||
}
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
216
src/palmos/metafile.cpp
Normal file
216
src/palmos/metafile.cpp
Normal file
@@ -0,0 +1,216 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/metafile.cpp
|
||||
// Purpose: wxMetafileDC etc.
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "metafile.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/setup.h"
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/metafile.h"
|
||||
|
||||
#if wxUSE_METAFILE && !defined(wxMETAFILE_IS_ENH)
|
||||
|
||||
#include "wx/clipbrd.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMetafile, wxObject)
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxMetafileDC, wxDC)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMetafileRefData
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Metafiles
|
||||
* Currently, the only purpose for making a metafile is to put
|
||||
* it on the clipboard.
|
||||
*/
|
||||
|
||||
wxMetafileRefData::wxMetafileRefData()
|
||||
{
|
||||
}
|
||||
|
||||
wxMetafileRefData::~wxMetafileRefData()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMetafile
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxMetafile::wxMetafile(const wxString& file)
|
||||
{
|
||||
}
|
||||
|
||||
wxMetafile::~wxMetafile()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxMetafile::SetClipboard(int width, int height)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMetafile::Play(wxDC *dc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxMetafile::SetHMETAFILE(WXHANDLE mf)
|
||||
{
|
||||
}
|
||||
|
||||
void wxMetafile::SetWindowsMappingMode(int mm)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Metafile device context
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Original constructor that does not takes origin and extent. If you use this,
|
||||
// *DO* give origin/extent arguments to wxMakeMetafilePlaceable.
|
||||
wxMetafileDC::wxMetafileDC(const wxString& file)
|
||||
{
|
||||
}
|
||||
|
||||
// New constructor that takes origin and extent. If you use this, don't
|
||||
// give origin/extent arguments to wxMakeMetafilePlaceable.
|
||||
wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg)
|
||||
{
|
||||
}
|
||||
|
||||
wxMetafileDC::~wxMetafileDC()
|
||||
{
|
||||
}
|
||||
|
||||
void wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y,
|
||||
long *descent, long *externalLeading, wxFont *theFont, bool WXUNUSED(use16bit)) const
|
||||
{
|
||||
}
|
||||
|
||||
wxMetafile *wxMetafileDC::Close()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxMetafileDC::SetMapMode(int mode)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMakeMetafilePlaceable
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifdef __WIN32__
|
||||
struct RECT32
|
||||
{
|
||||
short left;
|
||||
short top;
|
||||
short right;
|
||||
short bottom;
|
||||
};
|
||||
|
||||
struct mfPLACEABLEHEADER {
|
||||
DWORD key;
|
||||
short hmf;
|
||||
RECT32 bbox;
|
||||
WORD inch;
|
||||
DWORD reserved;
|
||||
WORD checksum;
|
||||
};
|
||||
#else
|
||||
struct mfPLACEABLEHEADER {
|
||||
DWORD key;
|
||||
HANDLE hmf;
|
||||
RECT bbox;
|
||||
WORD inch;
|
||||
DWORD reserved;
|
||||
WORD checksum;
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
|
||||
*
|
||||
*/
|
||||
|
||||
bool wxMakeMetafilePlaceable(const wxString& filename, float scale)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale, bool useOriginAndExtent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMetafileDataObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxMetafileDataObject::GetDataSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxMetafileDataObject::GetDataHere(void *buf) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMetafileDataObject::SetData(size_t WXUNUSED(len), const void *buf)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif // wxUSE_METAFILE
|
||||
|
||||
827
src/palmos/mimetype.cpp
Normal file
827
src/palmos/mimetype.cpp
Normal file
@@ -0,0 +1,827 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/mimetype.cpp
|
||||
// Purpose: classes and functions to manage MIME types
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 23.09.98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence (part of wxExtra library)
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "mimetype.h"
|
||||
#endif
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// This really doesn't apply to Palm OS
|
||||
#ifdef __PALMOS__
|
||||
|
||||
#if wxUSE_MIMETYPE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#if wxUSE_GUI
|
||||
#include "wx/icon.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#endif
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/iconloc.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/confbase.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "wx/palmos/registry.h"
|
||||
#include "wx/palmos/private.h"
|
||||
#endif // OS
|
||||
|
||||
#include "wx/palmos/mimetype.h"
|
||||
|
||||
// other standard headers
|
||||
#include <ctype.h>
|
||||
|
||||
// in case we're compiling in non-GUI mode
|
||||
class WXDLLEXPORT wxIcon;
|
||||
|
||||
// These classes use Windows registry to retrieve the required information.
|
||||
//
|
||||
// Keys used (not all of them are documented, so it might actually stop working
|
||||
// in future versions of Windows...):
|
||||
// 1. "HKCR\MIME\Database\Content Type" contains subkeys for all known MIME
|
||||
// types, each key has a string value "Extension" which gives (dot preceded)
|
||||
// extension for the files of this MIME type.
|
||||
//
|
||||
// 2. "HKCR\.ext" contains
|
||||
// a) unnamed value containing the "filetype"
|
||||
// b) value "Content Type" containing the MIME type
|
||||
//
|
||||
// 3. "HKCR\filetype" contains
|
||||
// a) unnamed value containing the description
|
||||
// b) subkey "DefaultIcon" with single unnamed value giving the icon index in
|
||||
// an icon file
|
||||
// c) shell\open\command and shell\open\print subkeys containing the commands
|
||||
// to open/print the file (the positional parameters are introduced by %1,
|
||||
// %2, ... in these strings, we change them to %s ourselves)
|
||||
|
||||
// although I don't know of any official documentation which mentions this
|
||||
// location, uses it, so it isn't likely to change
|
||||
static const wxChar *MIME_DATABASE_KEY = wxT("MIME\\Database\\Content Type\\");
|
||||
|
||||
// this function replaces Microsoft %1 with Unix-like %s
|
||||
static bool CanonicalizeParams(wxString& command)
|
||||
{
|
||||
// transform it from '%1' to '%s' style format string (now also test for %L
|
||||
// as apparently MS started using it as well for the same purpose)
|
||||
|
||||
// NB: we don't make any attempt to verify that the string is valid, i.e.
|
||||
// doesn't contain %2, or second %1 or .... But we do make sure that we
|
||||
// return a string with _exactly_ one '%s'!
|
||||
bool foundFilename = false;
|
||||
size_t len = command.length();
|
||||
for ( size_t n = 0; (n < len) && !foundFilename; n++ )
|
||||
{
|
||||
if ( command[n] == wxT('%') &&
|
||||
(n + 1 < len) &&
|
||||
(command[n + 1] == wxT('1') || command[n + 1] == wxT('L')) )
|
||||
{
|
||||
// replace it with '%s'
|
||||
command[n + 1] = wxT('s');
|
||||
|
||||
foundFilename = true;
|
||||
}
|
||||
}
|
||||
|
||||
return foundFilename;
|
||||
}
|
||||
|
||||
void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext)
|
||||
{
|
||||
// VZ: does it? (FIXME)
|
||||
wxCHECK_RET( !ext.IsEmpty(), _T("needs an extension") );
|
||||
|
||||
if ( ext[0u] != wxT('.') ) {
|
||||
m_ext = wxT('.');
|
||||
}
|
||||
m_ext << ext;
|
||||
|
||||
m_strFileType = strFileType;
|
||||
if ( !strFileType ) {
|
||||
m_strFileType = m_ext.AfterFirst('.') + _T("_auto_file");
|
||||
}
|
||||
}
|
||||
|
||||
wxString wxFileTypeImpl::GetVerbPath(const wxString& verb) const
|
||||
{
|
||||
wxString path;
|
||||
path << m_strFileType << _T("\\shell\\") << verb << _T("\\command");
|
||||
return path;
|
||||
}
|
||||
|
||||
size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,
|
||||
wxArrayString *commands,
|
||||
const wxFileType::MessageParameters& params) const
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), 0, _T("GetAllCommands() needs an extension") );
|
||||
|
||||
if ( m_strFileType.IsEmpty() )
|
||||
{
|
||||
// get it from the registry
|
||||
wxFileTypeImpl *self = wxConstCast(this, wxFileTypeImpl);
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_ext);
|
||||
if ( !rkey.Exists() || !rkey.QueryValue(wxEmptyString, self->m_strFileType) )
|
||||
{
|
||||
wxLogDebug(_T("Can't get the filetype for extension '%s'."),
|
||||
m_ext.c_str());
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// enum all subkeys of HKCR\filetype\shell
|
||||
size_t count = 0;
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\shell"));
|
||||
long dummy;
|
||||
wxString verb;
|
||||
bool ok = rkey.GetFirstKey(verb, dummy);
|
||||
while ( ok )
|
||||
{
|
||||
wxString command = wxFileType::ExpandCommand(GetCommand(verb), params);
|
||||
|
||||
// we want the open bverb to eb always the first
|
||||
|
||||
if ( verb.CmpNoCase(_T("open")) == 0 )
|
||||
{
|
||||
if ( verbs )
|
||||
verbs->Insert(verb, 0);
|
||||
if ( commands )
|
||||
commands->Insert(command, 0);
|
||||
}
|
||||
else // anything else than "open"
|
||||
{
|
||||
if ( verbs )
|
||||
verbs->Add(verb);
|
||||
if ( commands )
|
||||
commands->Add(command);
|
||||
}
|
||||
|
||||
count++;
|
||||
|
||||
ok = rkey.GetNextKey(verb, dummy);
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// modify the registry database
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFileTypeImpl::EnsureExtKeyExists()
|
||||
{
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_ext);
|
||||
if ( !rkey.Exists() )
|
||||
{
|
||||
if ( !rkey.Create() || !rkey.SetValue(wxEmptyString, m_strFileType) )
|
||||
{
|
||||
wxLogError(_("Failed to create registry entry for '%s' files."),
|
||||
m_ext.c_str());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// get the command to use
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const
|
||||
{
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
wxString strKey;
|
||||
|
||||
if ( wxRegKey(wxRegKey::HKCR, m_ext + _T("\\shell")).Exists() )
|
||||
strKey = m_ext;
|
||||
if ( wxRegKey(wxRegKey::HKCR, m_strFileType + _T("\\shell")).Exists() )
|
||||
strKey = m_strFileType;
|
||||
|
||||
if ( !strKey )
|
||||
{
|
||||
// no info
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
strKey << wxT("\\shell\\") << verb;
|
||||
wxRegKey key(wxRegKey::HKCR, strKey + _T("\\command"));
|
||||
wxString command;
|
||||
if ( key.Open(wxRegKey::Read) ) {
|
||||
// it's the default value of the key
|
||||
if ( key.QueryValue(wxEmptyString, command) ) {
|
||||
bool foundFilename = CanonicalizeParams(command);
|
||||
|
||||
#if wxUSE_IPC
|
||||
// look whether we must issue some DDE requests to the application
|
||||
// (and not just launch it)
|
||||
strKey += _T("\\DDEExec");
|
||||
wxRegKey keyDDE(wxRegKey::HKCR, strKey);
|
||||
if ( keyDDE.Open(wxRegKey::Read) ) {
|
||||
wxString ddeCommand, ddeServer, ddeTopic;
|
||||
keyDDE.QueryValue(wxEmptyString, ddeCommand);
|
||||
ddeCommand.Replace(_T("%1"), _T("%s"));
|
||||
|
||||
wxRegKey(wxRegKey::HKCR, strKey + _T("\\Application")).
|
||||
QueryValue(wxEmptyString, ddeServer);
|
||||
wxRegKey(wxRegKey::HKCR, strKey + _T("\\Topic")).
|
||||
QueryValue(wxEmptyString, ddeTopic);
|
||||
|
||||
if (ddeTopic.IsEmpty())
|
||||
ddeTopic = wxT("System");
|
||||
|
||||
// HACK: we use a special feature of wxExecute which exists
|
||||
// just because we need it here: it will establish DDE
|
||||
// conversation with the program it just launched
|
||||
command.Prepend(_T("WX_DDE#"));
|
||||
command << _T('#') << ddeServer
|
||||
<< _T('#') << ddeTopic
|
||||
<< _T('#') << ddeCommand;
|
||||
}
|
||||
else
|
||||
#endif // wxUSE_IPC
|
||||
if ( !foundFilename )
|
||||
{
|
||||
// we didn't find any '%1' - the application doesn't know which
|
||||
// file to open (note that we only do it if there is no DDEExec
|
||||
// subkey)
|
||||
//
|
||||
// HACK: append the filename at the end, hope that it will do
|
||||
command << wxT(" %s");
|
||||
}
|
||||
}
|
||||
}
|
||||
//else: no such file type or no value, will return empty string
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
bool
|
||||
wxFileTypeImpl::GetOpenCommand(wxString *openCmd,
|
||||
const wxFileType::MessageParameters& params)
|
||||
const
|
||||
{
|
||||
wxString cmd = GetCommand(wxT("open"));
|
||||
|
||||
*openCmd = wxFileType::ExpandCommand(cmd, params);
|
||||
|
||||
return !openCmd->IsEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
wxFileTypeImpl::GetPrintCommand(wxString *printCmd,
|
||||
const wxFileType::MessageParameters& params)
|
||||
const
|
||||
{
|
||||
wxString cmd = GetCommand(wxT("print"));
|
||||
|
||||
*printCmd = wxFileType::ExpandCommand(cmd, params);
|
||||
|
||||
return !printCmd->IsEmpty();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// getting other stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// TODO this function is half implemented
|
||||
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
|
||||
{
|
||||
if ( m_ext.IsEmpty() ) {
|
||||
// the only way to get the list of extensions from the file type is to
|
||||
// scan through all extensions in the registry - too slow...
|
||||
return FALSE;
|
||||
}
|
||||
else {
|
||||
extensions.Empty();
|
||||
extensions.Add(m_ext);
|
||||
|
||||
// it's a lie too, we don't return _all_ extensions...
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
|
||||
{
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
wxRegKey key(wxRegKey::HKCR, m_ext);
|
||||
|
||||
return key.Open(wxRegKey::Read) &&
|
||||
key.QueryValue(wxT("Content Type"), *mimeType);
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
|
||||
{
|
||||
wxString s;
|
||||
|
||||
if ( !GetMimeType(&s) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
mimeTypes.Clear();
|
||||
mimeTypes.Add(s);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
bool wxFileTypeImpl::GetIcon(wxIconLocation *iconLoc) const
|
||||
{
|
||||
wxString strIconKey;
|
||||
strIconKey << m_strFileType << wxT("\\DefaultIcon");
|
||||
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
wxRegKey key(wxRegKey::HKCR, strIconKey);
|
||||
|
||||
if ( key.Open(wxRegKey::Read) ) {
|
||||
wxString strIcon;
|
||||
// it's the default value of the key
|
||||
if ( key.QueryValue(wxEmptyString, strIcon) ) {
|
||||
// the format is the following: <full path to file>, <icon index>
|
||||
// NB: icon index may be negative as well as positive and the full
|
||||
// path may contain the environment variables inside '%'
|
||||
wxString strFullPath = strIcon.BeforeLast(wxT(',')),
|
||||
strIndex = strIcon.AfterLast(wxT(','));
|
||||
|
||||
// index may be omitted, in which case BeforeLast(',') is empty and
|
||||
// AfterLast(',') is the whole string
|
||||
if ( strFullPath.IsEmpty() ) {
|
||||
strFullPath = strIndex;
|
||||
strIndex = wxT("0");
|
||||
}
|
||||
|
||||
if ( iconLoc )
|
||||
{
|
||||
iconLoc->SetFileName(wxExpandEnvVars(strFullPath));
|
||||
|
||||
iconLoc->SetIndex(wxAtoi(strIndex));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// no such file type or no value or incorrect icon entry
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::GetDescription(wxString *desc) const
|
||||
{
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
wxRegKey key(wxRegKey::HKCR, m_strFileType);
|
||||
|
||||
if ( key.Open(wxRegKey::Read) ) {
|
||||
// it's the default value of the key
|
||||
if ( key.QueryValue(wxEmptyString, *desc) ) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// helper function
|
||||
wxFileType *
|
||||
wxMimeTypesManagerImpl::CreateFileType(const wxString& filetype, const wxString& ext)
|
||||
{
|
||||
wxFileType *fileType = new wxFileType;
|
||||
fileType->m_impl->Init(filetype, ext);
|
||||
return fileType;
|
||||
}
|
||||
|
||||
// extension -> file type
|
||||
wxFileType *
|
||||
wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
|
||||
{
|
||||
// add the leading point if necessary
|
||||
wxString str;
|
||||
if ( ext[0u] != wxT('.') ) {
|
||||
str = wxT('.');
|
||||
}
|
||||
str << ext;
|
||||
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
|
||||
bool knownExtension = FALSE;
|
||||
|
||||
wxString strFileType;
|
||||
wxRegKey key(wxRegKey::HKCR, str);
|
||||
if ( key.Open(wxRegKey::Read) ) {
|
||||
// it's the default value of the key
|
||||
if ( key.QueryValue(wxEmptyString, strFileType) ) {
|
||||
// create the new wxFileType object
|
||||
return CreateFileType(strFileType, ext);
|
||||
}
|
||||
else {
|
||||
// this extension doesn't have a filetype, but it's known to the
|
||||
// system and may be has some other useful keys (open command or
|
||||
// content-type), so still return a file type object for it
|
||||
knownExtension = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !knownExtension )
|
||||
{
|
||||
// unknown extension
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return CreateFileType(wxEmptyString, ext);
|
||||
}
|
||||
|
||||
/*
|
||||
wxFileType *
|
||||
wxMimeTypesManagerImpl::GetOrAllocateFileTypeFromExtension(const wxString& ext)
|
||||
{
|
||||
wxFileType *fileType = GetFileTypeFromExtension(ext);
|
||||
if ( !fileType )
|
||||
{
|
||||
fileType = CreateFileType(wxEmptyString, ext);
|
||||
}
|
||||
|
||||
return fileType;
|
||||
}
|
||||
*/
|
||||
|
||||
// MIME type -> extension -> file type
|
||||
wxFileType *
|
||||
wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType)
|
||||
{
|
||||
wxString strKey = MIME_DATABASE_KEY;
|
||||
strKey << mimeType;
|
||||
|
||||
// suppress possible error messages
|
||||
wxLogNull nolog;
|
||||
|
||||
wxString ext;
|
||||
wxRegKey key(wxRegKey::HKCR, strKey);
|
||||
if ( key.Open(wxRegKey::Read) ) {
|
||||
if ( key.QueryValue(wxT("Extension"), ext) ) {
|
||||
return GetFileTypeFromExtension(ext);
|
||||
}
|
||||
}
|
||||
|
||||
// unknown MIME type
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
|
||||
{
|
||||
// enumerate all keys under MIME_DATABASE_KEY
|
||||
wxRegKey key(wxRegKey::HKCR, MIME_DATABASE_KEY);
|
||||
|
||||
wxString type;
|
||||
long cookie;
|
||||
bool cont = key.GetFirstKey(type, cookie);
|
||||
while ( cont )
|
||||
{
|
||||
mimetypes.Add(type);
|
||||
|
||||
cont = key.GetNextKey(type, cookie);
|
||||
}
|
||||
|
||||
return mimetypes.GetCount();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// create a new association
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
|
||||
{
|
||||
wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL,
|
||||
_T("Associate() needs extension") );
|
||||
|
||||
bool ok;
|
||||
int iExtCount = 0 ;
|
||||
wxString filetype;
|
||||
wxString extWithDot;
|
||||
|
||||
wxString ext = ftInfo.GetExtensions()[iExtCount];
|
||||
|
||||
wxCHECK_MSG( !ext.empty(), NULL,
|
||||
_T("Associate() needs non empty extension") );
|
||||
|
||||
if ( ext[0u] != _T('.') )
|
||||
extWithDot = _T('.');
|
||||
extWithDot += ext;
|
||||
|
||||
// start by setting the HKCR\\.ext entries
|
||||
// default is filetype; content type is mimetype
|
||||
const wxString& filetypeOrig = ftInfo.GetShortDesc();
|
||||
|
||||
wxRegKey key(wxRegKey::HKCR, extWithDot);
|
||||
if ( !key.Exists() )
|
||||
{
|
||||
// create the mapping from the extension to the filetype
|
||||
ok = key.Create();
|
||||
if ( ok )
|
||||
{
|
||||
|
||||
if ( filetypeOrig.empty() )
|
||||
{
|
||||
// make it up from the extension
|
||||
filetype << extWithDot.c_str() + 1 << _T("_file");
|
||||
}
|
||||
else
|
||||
{
|
||||
// just use the provided one
|
||||
filetype = filetypeOrig;
|
||||
}
|
||||
|
||||
key.SetValue(wxEmptyString, filetype);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// key already exists, maybe we want to change it ??
|
||||
if (!filetypeOrig.empty())
|
||||
{
|
||||
filetype = filetypeOrig;
|
||||
key.SetValue(wxEmptyString, filetype);
|
||||
}
|
||||
else
|
||||
{
|
||||
key.QueryValue(wxEmptyString, filetype);
|
||||
}
|
||||
}
|
||||
// now set a mimetypeif we have it, but ignore it if none
|
||||
const wxString& mimetype = ftInfo.GetMimeType();
|
||||
if ( !mimetype.empty() )
|
||||
{
|
||||
// set the MIME type
|
||||
ok = key.SetValue(_T("Content Type"), mimetype);
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
// create the MIME key
|
||||
wxString strKey = MIME_DATABASE_KEY;
|
||||
strKey << mimetype;
|
||||
wxRegKey keyMIME(wxRegKey::HKCR, strKey);
|
||||
ok = keyMIME.Create();
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
// and provide a back link to the extension
|
||||
keyMIME.SetValue(_T("Extension"), extWithDot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// now make other extensions have the same filetype
|
||||
|
||||
for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ )
|
||||
{
|
||||
ext = ftInfo.GetExtensions()[iExtCount];
|
||||
if ( ext[0u] != _T('.') )
|
||||
extWithDot = _T('.');
|
||||
extWithDot += ext;
|
||||
|
||||
wxRegKey key(wxRegKey::HKCR, extWithDot);
|
||||
if ( !key.Exists() ) key.Create();
|
||||
key.SetValue(wxEmptyString, filetype);
|
||||
|
||||
// now set any mimetypes we may have, but ignore it if none
|
||||
const wxString& mimetype = ftInfo.GetMimeType();
|
||||
if ( !mimetype.empty() )
|
||||
{
|
||||
// set the MIME type
|
||||
ok = key.SetValue(_T("Content Type"), mimetype);
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
// create the MIME key
|
||||
wxString strKey = MIME_DATABASE_KEY;
|
||||
strKey << mimetype;
|
||||
wxRegKey keyMIME(wxRegKey::HKCR, strKey);
|
||||
ok = keyMIME.Create();
|
||||
|
||||
if ( ok )
|
||||
{
|
||||
// and provide a back link to the extension
|
||||
keyMIME.SetValue(_T("Extension"), extWithDot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // end of for loop; all extensions now point to HKCR\.ext\Default
|
||||
|
||||
// create the filetype key itself (it will be empty for now, but
|
||||
// SetCommand(), SetDefaultIcon() &c will use it later)
|
||||
wxRegKey keyFT(wxRegKey::HKCR, filetype);
|
||||
keyFT.Create();
|
||||
|
||||
wxFileType *ft = CreateFileType(filetype, extWithDot);
|
||||
|
||||
if (ft)
|
||||
{
|
||||
if (! ftInfo.GetOpenCommand ().IsEmpty() ) ft->SetCommand (ftInfo.GetOpenCommand (), wxT("open" ) );
|
||||
if (! ftInfo.GetPrintCommand().IsEmpty() ) ft->SetCommand (ftInfo.GetPrintCommand(), wxT("print" ) );
|
||||
// chris: I don't like the ->m_impl-> here FIX this ??
|
||||
if (! ftInfo.GetDescription ().IsEmpty() ) ft->m_impl->SetDescription (ftInfo.GetDescription ()) ;
|
||||
if (! ftInfo.GetIconFile().IsEmpty() ) ft->SetDefaultIcon (ftInfo.GetIconFile(), ftInfo.GetIconIndex() );
|
||||
|
||||
}
|
||||
return ft;
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::SetCommand(const wxString& cmd,
|
||||
const wxString& verb,
|
||||
bool WXUNUSED(overwriteprompt))
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE,
|
||||
_T("SetCommand() needs an extension and a verb") );
|
||||
|
||||
if ( !EnsureExtKeyExists() )
|
||||
return FALSE;
|
||||
|
||||
wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb));
|
||||
#if 0
|
||||
if ( rkey.Exists() && overwriteprompt )
|
||||
{
|
||||
#if wxUSE_GUI
|
||||
wxString old;
|
||||
rkey.QueryValue(wxEmptyString, old);
|
||||
if ( wxMessageBox
|
||||
(
|
||||
wxString::Format(
|
||||
_("Do you want to overwrite the command used to %s "
|
||||
"files with extension \"%s\" ?\nCurrent value is \n%s, "
|
||||
"\nNew value is \n%s %1"), // bug here FIX need %1 ??
|
||||
verb.c_str(),
|
||||
m_ext.c_str(),
|
||||
old.c_str(),
|
||||
cmd.c_str()),
|
||||
_("Confirm registry update"),
|
||||
wxYES_NO | wxICON_QUESTION
|
||||
) != wxYES )
|
||||
#endif // wxUSE_GUI
|
||||
{
|
||||
// cancelled by user
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// TODO:
|
||||
// 1. translate '%s' to '%1' instead of always adding it
|
||||
// 2. create DDEExec value if needed (undo GetCommand)
|
||||
return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + _T(" \"%1\"") );
|
||||
}
|
||||
|
||||
/* // no longer used
|
||||
bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig)
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetMimeType() needs extension") );
|
||||
|
||||
if ( !EnsureExtKeyExists() )
|
||||
return FALSE;
|
||||
|
||||
// VZ: is this really useful? (FIXME)
|
||||
wxString mimeType;
|
||||
if ( !mimeTypeOrig )
|
||||
{
|
||||
// make up a default value for it
|
||||
wxString cmd;
|
||||
wxSplitPath(GetCommand(_T("open")), NULL, &cmd, NULL);
|
||||
mimeType << _T("application/x-") << cmd;
|
||||
}
|
||||
else
|
||||
{
|
||||
mimeType = mimeTypeOrig;
|
||||
}
|
||||
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_ext);
|
||||
return rkey.Create() && rkey.SetValue(_T("Content Type"), mimeType);
|
||||
}
|
||||
*/
|
||||
|
||||
bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index)
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("SetDefaultIcon() needs extension") );
|
||||
wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") );
|
||||
// the next line fails on a SMBshare, I think because it is case mangled
|
||||
// wxCHECK_MSG( !wxFileExists(cmd), FALSE, _T("Icon file not found.") );
|
||||
|
||||
if ( !EnsureExtKeyExists() )
|
||||
return FALSE;
|
||||
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
|
||||
|
||||
return rkey.Create() &&
|
||||
rkey.SetValue(wxEmptyString,
|
||||
wxString::Format(_T("%s,%d"), cmd.c_str(), index));
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::SetDescription (const wxString& desc)
|
||||
{
|
||||
wxCHECK_MSG( !m_strFileType.IsEmpty(), FALSE, _T("File key not found") );
|
||||
wxCHECK_MSG( !desc.IsEmpty(), FALSE, _T("No file description supplied") );
|
||||
|
||||
if ( !EnsureExtKeyExists() )
|
||||
return FALSE;
|
||||
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_strFileType );
|
||||
|
||||
return rkey.Create() &&
|
||||
rkey.SetValue(wxEmptyString, desc);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// remove file association
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFileTypeImpl::Unassociate()
|
||||
{
|
||||
bool result = TRUE;
|
||||
if ( !RemoveOpenCommand() )
|
||||
result = FALSE;
|
||||
if ( !RemoveDefaultIcon() )
|
||||
result = FALSE;
|
||||
if ( !RemoveMimeType() )
|
||||
result = FALSE;
|
||||
if ( !RemoveDescription() )
|
||||
result = FALSE;
|
||||
|
||||
/*
|
||||
//this might hold other keys, eg some have CSLID keys
|
||||
if ( result )
|
||||
{
|
||||
// delete the root key
|
||||
wxRegKey key(wxRegKey::HKCR, m_ext);
|
||||
if ( key.Exists() )
|
||||
result = key.DeleteSelf();
|
||||
}
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::RemoveOpenCommand()
|
||||
{
|
||||
return RemoveCommand(_T("open"));
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::RemoveCommand(const wxString& verb)
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty() && !verb.IsEmpty(), FALSE,
|
||||
_T("RemoveCommand() needs an extension and a verb") );
|
||||
|
||||
wxString sKey = m_strFileType;
|
||||
wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb));
|
||||
|
||||
// if the key already doesn't exist, it's a success
|
||||
return !rkey.Exists() || rkey.DeleteSelf();
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::RemoveMimeType()
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), FALSE, _T("RemoveMimeType() needs extension") );
|
||||
|
||||
wxRegKey rkey(wxRegKey::HKCR, m_ext);
|
||||
return !rkey.Exists() || rkey.DeleteSelf();
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::RemoveDefaultIcon()
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), FALSE,
|
||||
_T("RemoveDefaultIcon() needs extension") );
|
||||
|
||||
wxRegKey rkey (wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon"));
|
||||
return !rkey.Exists() || rkey.DeleteSelf();
|
||||
}
|
||||
|
||||
bool wxFileTypeImpl::RemoveDescription()
|
||||
{
|
||||
wxCHECK_MSG( !m_ext.IsEmpty(), FALSE,
|
||||
_T("RemoveDescription() needs extension") );
|
||||
|
||||
wxRegKey rkey (wxRegKey::HKCR, m_strFileType );
|
||||
return !rkey.Exists() || rkey.DeleteSelf();
|
||||
}
|
||||
|
||||
#endif // wxUSE_MIMETYPE
|
||||
#endif // __PALMOS__
|
||||
29
src/palmos/minifram.cpp
Normal file
29
src/palmos/minifram.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: minifram.cpp
|
||||
// Purpose: wxMiniFrame
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "minifram.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#endif
|
||||
|
||||
#include "wx/minifram.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)
|
||||
|
||||
161
src/palmos/msgdlg.cpp
Normal file
161
src/palmos/msgdlg.cpp
Normal file
@@ -0,0 +1,161 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msgdlg.cpp
|
||||
// Purpose: wxMessageDialog
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "msgdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/defs.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#endif
|
||||
|
||||
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
|
||||
|
||||
wxMessageDialog::wxMessageDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
long style,
|
||||
const wxPoint& WXUNUSED(pos))
|
||||
{
|
||||
#ifdef __WXDEBUG__
|
||||
// check for common programming errors
|
||||
if ( (style & wxID_OK) == wxID_OK )
|
||||
{
|
||||
// programmer probably confused wxID_OK with wxOK. Correct one is wxOK.
|
||||
wxFAIL_MSG( _T("wxMessageBox: Did you mean wxOK (and not wxID_OK)?") );
|
||||
}
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
m_caption = caption;
|
||||
m_message = message;
|
||||
m_dialogStyle = style;
|
||||
m_parent = parent;
|
||||
}
|
||||
|
||||
int wxMessageDialog::ShowModal()
|
||||
{
|
||||
int AlertID=1000;
|
||||
int Result=0;
|
||||
int wxResult=wxID_OK;
|
||||
|
||||
// Handle to the currently running application database
|
||||
DmOpenRef AppDB;
|
||||
SysGetModuleDatabase(SysGetRefNum(), NULL, &AppDB);
|
||||
|
||||
// Translate wx styles into Palm OS styles
|
||||
if (m_dialogStyle & wxYES_NO)
|
||||
{
|
||||
if (m_dialogStyle & wxCANCEL)
|
||||
AlertID=1300; // Yes No Cancel
|
||||
else
|
||||
AlertID=1200; // Yes No
|
||||
}
|
||||
if (m_dialogStyle & wxOK)
|
||||
{
|
||||
if (m_dialogStyle & wxCANCEL)
|
||||
AlertID=1100; // Ok Cancel
|
||||
else
|
||||
AlertID=1000; // Ok
|
||||
}
|
||||
|
||||
// Add the icon styles
|
||||
if (m_dialogStyle & wxICON_EXCLAMATION)
|
||||
AlertID=AlertID+0; // Warning
|
||||
else if (m_dialogStyle & wxICON_HAND)
|
||||
AlertID=AlertID+1; // Error
|
||||
else if (m_dialogStyle & wxICON_INFORMATION)
|
||||
AlertID=AlertID+2; // Information
|
||||
else if (m_dialogStyle & wxICON_QUESTION)
|
||||
AlertID=AlertID+3; // Confirmation
|
||||
|
||||
// The Palm OS Dialog API does not support custom titles in a dialog box.
|
||||
// So we have to set the title by manipulating the resource.
|
||||
|
||||
// Get the alert resource
|
||||
char *AlertPtr;
|
||||
MemHandle AlertHandle;
|
||||
AlertHandle=DmGetResource(AppDB,'Talt',AlertID);
|
||||
|
||||
AlertPtr=(char *)MemHandleLock(AlertHandle);
|
||||
AlertPtr+=8;
|
||||
|
||||
// Clear out any old title. This must be done with a static array of chars
|
||||
// because using MemSet is not supported on resources and could result in
|
||||
// crashes or unpredictable behaviour.
|
||||
char ClearTitle[25]={' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '};
|
||||
MemMove(AlertPtr,&ClearTitle,25);
|
||||
|
||||
// Get the title length and make sure it is not too long
|
||||
int TitleLength=m_caption.length();
|
||||
if(TitleLength>25)
|
||||
TitleLength=25;
|
||||
|
||||
// Center the title in the window
|
||||
int BufferLength=(25-TitleLength)/2;
|
||||
AlertPtr+=BufferLength;
|
||||
|
||||
// Copy the title
|
||||
MemMove(AlertPtr,m_caption.c_str(),TitleLength);
|
||||
|
||||
// Release the resource
|
||||
MemHandleUnlock(AlertHandle);
|
||||
DmReleaseResource(AlertHandle);
|
||||
|
||||
// Display the dialog
|
||||
Result=FrmCustomAlert(AppDB,AlertID,m_message.c_str(),"","");
|
||||
|
||||
// Convert the Palm OS result to wxResult
|
||||
if(AlertID<1100)
|
||||
{
|
||||
// Ok
|
||||
wxResult=wxID_OK;
|
||||
}
|
||||
else if(AlertID<1200)
|
||||
{
|
||||
// Ok Cancel
|
||||
if(Result==0)
|
||||
wxResult=wxID_OK;
|
||||
else
|
||||
wxResult=wxID_CANCEL;
|
||||
}
|
||||
else if(AlertID<1300)
|
||||
{
|
||||
// Yes No
|
||||
if(Result==0)
|
||||
wxResult=wxID_YES;
|
||||
else
|
||||
wxResult=wxID_NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Yes No Cancel
|
||||
if(Result==0)
|
||||
wxResult=wxID_YES;
|
||||
else if(Result==1)
|
||||
wxResult=wxID_NO;
|
||||
else
|
||||
wxResult=wxID_CANCEL;
|
||||
}
|
||||
|
||||
return wxResult;
|
||||
}
|
||||
|
||||
211
src/palmos/mslu.cpp
Normal file
211
src/palmos/mslu.cpp
Normal file
@@ -0,0 +1,211 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msw/mslu.cpp
|
||||
// Purpose: Fixes for bugs in MSLU
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 2002/02/17
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2002 Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
// This may or may not apply to Palm OS in the future, but for right now Unicode
|
||||
// is not supported.
|
||||
#ifndef __PALMOS__
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#include <dir.h>
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_UNICODE_MSLU
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//
|
||||
// NB: MSLU only covers Win32 API, it doesn't provide Unicode implementation of
|
||||
// libc functions. Unfortunately, some of MSVCRT wchar_t functions
|
||||
// (e.g. _wopen) don't work on Windows 9x, so we have to workaround it
|
||||
// by calling the char version. We still want to use wchar_t version on
|
||||
// NT/2000/XP, though, because they allow for Unicode file names.
|
||||
//
|
||||
// Moreover, there are bugs in unicows.dll, of course. We have to
|
||||
// workaround them, too.
|
||||
//
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
#include "wx/msw/mslu.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef __VISUALC__
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
// Undef redirection macros defined in wx/msw/mslu.h:
|
||||
#undef DrawStateW
|
||||
#undef GetOpenFileNameW
|
||||
#undef GetSaveFileNameW
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Wrongly implemented functions from unicows.dll
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
WXDLLEXPORT int wxMSLU_DrawStateW(WXHDC dc, WXHBRUSH br, WXFARPROC outputFunc,
|
||||
WXLPARAM lData, WXWPARAM wData,
|
||||
int x, int y, int cx, int cy,
|
||||
unsigned int flags)
|
||||
{
|
||||
// VS: There's yet another bug in MSLU: DrawStateW behaves like if it was
|
||||
// expecting char*, not wchar_t* input. We have to use DrawStateA
|
||||
// explicitly.
|
||||
|
||||
if ( wxUsingUnicowsDll() )
|
||||
{
|
||||
return DrawStateA((HDC)dc, (HBRUSH)br, (DRAWSTATEPROC)outputFunc,
|
||||
(LPARAM)(const char*)
|
||||
wxConvLocal.cWX2MB((const wxChar*)lData),
|
||||
wData, x, y, cx, cy, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
return DrawStateW((HDC)dc, (HBRUSH)br, (DRAWSTATEPROC)outputFunc,
|
||||
lData, wData, x, y, cx, cy, flags);
|
||||
}
|
||||
}
|
||||
|
||||
static void wxFixOPENFILENAME(LPOPENFILENAME ofn)
|
||||
{
|
||||
#ifdef OFN_EXPLORER
|
||||
// VS: there's a bug in unicows.dll - when multiple files are selected,
|
||||
// of.nFileOffset doesn't point to the first filename but rather to
|
||||
// the last component of directory name. This bug is known to MSLU
|
||||
// developers, but they are not going to fix it: "this is a true
|
||||
// limitation, that we have decided to live with" and "working
|
||||
// harder on this case just did not seem worth the effort"...
|
||||
//
|
||||
// Our only option is to try to fix it ourselves:
|
||||
|
||||
if ( (ofn->Flags & OFN_ALLOWMULTISELECT) &&
|
||||
ofn->lpstrFile[ofn->nFileOffset-1] != wxT('\0') )
|
||||
{
|
||||
if ( wxDirExists(ofn->lpstrFile) )
|
||||
{
|
||||
// 1st component is dir => multiple files selected
|
||||
ofn->nFileOffset = wxStrlen(ofn->lpstrFile)+1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU_GetOpenFileNameW(void *ofn)
|
||||
{
|
||||
int ret = GetOpenFileName((LPOPENFILENAME)ofn);
|
||||
if ( wxUsingUnicowsDll() && ret != 0 )
|
||||
wxFixOPENFILENAME((LPOPENFILENAME)ofn);
|
||||
return ret;
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU_GetSaveFileNameW(void *ofn)
|
||||
{
|
||||
int ret = GetSaveFileName((LPOPENFILENAME)ofn);
|
||||
if ( wxUsingUnicowsDll() && ret != 0 )
|
||||
wxFixOPENFILENAME((LPOPENFILENAME)ofn);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Missing libc file manipulation functions in Win9x
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_BASE
|
||||
|
||||
WXDLLEXPORT int wxMSLU__trename(const wxChar *oldname, const wxChar *newname)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return rename(wxConvFile.cWX2MB(oldname), wxConvFile.cWX2MB(newname));
|
||||
else
|
||||
return _trename(oldname, newname);
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU__tremove(const wxChar *name)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return remove(wxConvFile.cWX2MB(name));
|
||||
else
|
||||
return _tremove(name);
|
||||
}
|
||||
|
||||
#if defined( __VISUALC__ ) \
|
||||
|| ( defined(__MINGW32__) && wxCHECK_W32API_VERSION( 0, 5 ) ) \
|
||||
|| ( defined(__MWERKS__) && defined(__WXMSW__) ) \
|
||||
|| ( defined(__BORLANDC__) && (__BORLANDC__ > 0x460) )
|
||||
|
||||
WXDLLEXPORT int wxMSLU__wopen(const wxChar *name, int flags, int mode)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
#ifdef __BORLANDC__
|
||||
return open(wxConvFile.cWX2MB(name), flags, mode);
|
||||
#else
|
||||
return _open(wxConvFile.cWX2MB(name), flags, mode);
|
||||
#endif
|
||||
else
|
||||
return _wopen(name, flags, mode);
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU__waccess(const wxChar *name, int mode)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return _access(wxConvFile.cWX2MB(name), mode);
|
||||
else
|
||||
return _waccess(name, mode);
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU__wmkdir(const wxChar *name)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return _mkdir(wxConvFile.cWX2MB(name));
|
||||
else
|
||||
return _wmkdir(name);
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU__wrmdir(const wxChar *name)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return _rmdir(wxConvFile.cWX2MB(name));
|
||||
else
|
||||
return _wrmdir(name);
|
||||
}
|
||||
|
||||
WXDLLEXPORT int wxMSLU__wstat(const wxChar *name, struct _stat *buffer)
|
||||
{
|
||||
if ( wxUsingUnicowsDll() )
|
||||
return _stat((const char*)wxConvFile.cWX2MB(name), buffer);
|
||||
else
|
||||
return _wstat(name, buffer);
|
||||
}
|
||||
|
||||
#endif // compilers having wopen() &c
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#endif // wxUSE_UNICODE_MSLU
|
||||
|
||||
#endif // __PALMOS__
|
||||
84
src/palmos/nativdlg.cpp
Normal file
84
src/palmos/nativdlg.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: nativdlg.cpp
|
||||
// Purpose: Native dialog loading code (part of wxWindow)
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/spinbutt.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxWindow::LoadNativeDialog(wxWindow* parent, const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// look for child by id
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxWindow* wxWindow::GetWindowChild1(wxWindowID id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxWindow* wxWindow::GetWindowChild(wxWindowID id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// create wxWin window from a native HWND
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Make sure the window style (etc.) reflects the HWND style (roughly)
|
||||
void wxWindow::AdoptAttributesFromHWND(void)
|
||||
{
|
||||
}
|
||||
|
||||
412
src/palmos/notebook.cpp
Normal file
412
src/palmos/notebook.cpp
Normal file
@@ -0,0 +1,412 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/notebook.cpp
|
||||
// Purpose: implementation of wxNotebook
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
// wxWidgets
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/imaglist.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#include "wx/palmos/winundef.h"
|
||||
|
||||
#if wxUSE_UXTHEME
|
||||
#include "wx/palmos/uxtheme.h"
|
||||
|
||||
#include "wx/radiobut.h"
|
||||
#include "wx/radiobox.h"
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/statline.h"
|
||||
#include "wx/statbox.h"
|
||||
#include "wx/stattext.h"
|
||||
#include "wx/slider.h"
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/panel.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// check that the page index is valid
|
||||
#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
|
||||
|
||||
// hide the ugly cast
|
||||
#define m_hwnd (HWND)GetHWND()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This is a work-around for missing defines in gcc-2.95 headers
|
||||
#ifndef TCS_RIGHT
|
||||
#define TCS_RIGHT 0x0002
|
||||
#endif
|
||||
|
||||
#ifndef TCS_VERTICAL
|
||||
#define TCS_VERTICAL 0x0080
|
||||
#endif
|
||||
|
||||
#ifndef TCS_BOTTOM
|
||||
#define TCS_BOTTOM TCS_RIGHT
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event table
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include <wx/listimpl.cpp>
|
||||
|
||||
WX_DEFINE_LIST( wxNotebookPageInfoList ) ;
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxNotebookStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxNotebookStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxNB_FIXEDWIDTH)
|
||||
wxFLAGS_MEMBER(wxNB_LEFT)
|
||||
wxFLAGS_MEMBER(wxNB_RIGHT)
|
||||
wxFLAGS_MEMBER(wxNB_BOTTOM)
|
||||
|
||||
wxEND_FLAGS( wxNotebookStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook, wxControl,"wx/notebook.h")
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebookPageInfo, wxObject , "wx/notebook.h" )
|
||||
|
||||
wxCOLLECTION_TYPE_INFO( wxNotebookPageInfo * , wxNotebookPageInfoList ) ;
|
||||
|
||||
template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theList, wxxVariantArray &value)
|
||||
{
|
||||
wxListCollectionToVariantArray<wxNotebookPageInfoList::compatibility_iterator>( theList , value ) ;
|
||||
}
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxNotebook)
|
||||
wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxNotebookEvent )
|
||||
wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxNotebookEvent )
|
||||
|
||||
wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxNotebook)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxNotebook , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
|
||||
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxNotebookPageInfo)
|
||||
wxREADONLY_PROPERTY( Page , wxNotebookPage* , GetPage , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxREADONLY_PROPERTY( Text , wxString , GetText , wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxREADONLY_PROPERTY( Selected , bool , GetSelected , false, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxREADONLY_PROPERTY( ImageId , int , GetImageId , -1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxNotebookPageInfo)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text , bool , Selected , int , ImageId )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject )
|
||||
#endif
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
const wxNotebookPageInfoList& wxNotebook::GetPageInfos() const
|
||||
{
|
||||
wxNotebookPageInfoList* list;
|
||||
|
||||
return m_pageInfos ;
|
||||
}
|
||||
|
||||
// common part of all ctors
|
||||
void wxNotebook::Init()
|
||||
{
|
||||
}
|
||||
|
||||
// default for dynamic class
|
||||
wxNotebook::wxNotebook()
|
||||
{
|
||||
}
|
||||
|
||||
// the same arguments as for wxControl
|
||||
wxNotebook::wxNotebook(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
}
|
||||
|
||||
// Create() function
|
||||
bool wxNotebook::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxNotebook::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
size_t wxNotebook::GetPageCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxNotebook::GetRowCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxNotebook::SetSelection(size_t nPage)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxString wxNotebook::GetPageText(size_t nPage) const
|
||||
{
|
||||
wxString str;
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
int wxNotebook::GetPageImage(size_t nPage) const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxNotebook::SetImageList(wxImageList* imageList)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook size settings
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxNotebook::SetPageSize(const wxSize& size)
|
||||
{
|
||||
}
|
||||
|
||||
void wxNotebook::SetPadding(const wxSize& padding)
|
||||
{
|
||||
}
|
||||
|
||||
void wxNotebook::SetTabSize(const wxSize& sz)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxNotebook::AdjustPageSize(wxNotebookPage *page)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// remove one page from the notebook, without deleting
|
||||
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// remove all pages
|
||||
bool wxNotebook::DeleteAllPages()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// same as AddPage() but does it at given position
|
||||
bool wxNotebook::InsertPage(size_t nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect,
|
||||
int imageId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook callbacks
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxNotebook::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxNotebook::OnSelChange(wxNotebookEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxNotebook::MSWTranslateMessage(WXMSG *wxmsg)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook base class virtuals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_CONSTRAINTS
|
||||
|
||||
// override these 2 functions to do nothing: everything is done in OnSize
|
||||
|
||||
void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
|
||||
{
|
||||
}
|
||||
|
||||
bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // wxUSE_CONSTRAINTS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook Windows message handlers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxNotebook::MSWOnScroll(int orientation, WXWORD nSBCode,
|
||||
WXWORD pos, WXHWND control)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Windows only: attempts to get colour for UX theme page background
|
||||
wxColour wxNotebook::GetThemeBackgroundColour()
|
||||
{
|
||||
return wxColour;
|
||||
}
|
||||
|
||||
// Windows only: attempts to apply the UX theme page background to this page
|
||||
#if wxUSE_UXTHEME
|
||||
void wxNotebook::ApplyThemeBackground(wxWindow* window, const wxColour& colour)
|
||||
#else
|
||||
void wxNotebook::ApplyThemeBackground(wxWindow*, const wxColour&)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
#if wxUSE_UXTHEME
|
||||
WXLRESULT wxNotebook::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif // #if wxUSE_UXTHEME
|
||||
|
||||
#endif // wxUSE_NOTEBOOK
|
||||
130
src/palmos/ownerdrw.cpp
Normal file
130
src/palmos/ownerdrw.cpp
Normal file
@@ -0,0 +1,130 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/ownerdrw.cpp
|
||||
// Purpose: implementation of wxOwnerDrawn class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/utils.h"
|
||||
#endif
|
||||
|
||||
#include "wx/settings.h"
|
||||
#include "wx/ownerdrw.h"
|
||||
#include "wx/menuitem.h"
|
||||
#include "wx/fontutil.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
|
||||
class wxMSWSystemMenuFontModule : public wxModule
|
||||
{
|
||||
public:
|
||||
|
||||
virtual bool OnInit()
|
||||
{
|
||||
ms_systemMenuFont = new wxFont;
|
||||
|
||||
#if defined(__WXMSW__) && defined(__WIN32__) && defined(SM_CXMENUCHECK)
|
||||
NONCLIENTMETRICS nm;
|
||||
nm.cbSize = sizeof(NONCLIENTMETRICS);
|
||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,0,&nm,0);
|
||||
|
||||
ms_systemMenuButtonWidth = nm.iMenuHeight;
|
||||
ms_systemMenuHeight = nm.iMenuHeight;
|
||||
|
||||
// create menu font
|
||||
wxNativeFontInfo info;
|
||||
memcpy(&info.lf, &nm.lfMenuFont, sizeof(LOGFONT));
|
||||
ms_systemMenuFont->Create(info);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void OnExit()
|
||||
{
|
||||
delete ms_systemMenuFont;
|
||||
ms_systemMenuFont = NULL;
|
||||
}
|
||||
|
||||
static wxFont* ms_systemMenuFont;
|
||||
static int ms_systemMenuButtonWidth; // windows clean install default
|
||||
static int ms_systemMenuHeight; // windows clean install default
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule)
|
||||
};
|
||||
|
||||
// these static variables are by the wxMSWSystemMenuFontModule object
|
||||
// and reflect the system settings returned by the Win32 API's
|
||||
// SystemParametersInfo() call.
|
||||
|
||||
wxFont* wxMSWSystemMenuFontModule::ms_systemMenuFont = NULL;
|
||||
int wxMSWSystemMenuFontModule::ms_systemMenuButtonWidth = 18; // windows clean install default
|
||||
int wxMSWSystemMenuFontModule::ms_systemMenuHeight = 18; // windows clean install default
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMSWSystemMenuFontModule, wxModule)
|
||||
|
||||
// ============================================================================
|
||||
// implementation of wxOwnerDrawn class
|
||||
// ============================================================================
|
||||
|
||||
// ctor
|
||||
// ----
|
||||
wxOwnerDrawn::wxOwnerDrawn(const wxString& str,
|
||||
bool bCheckable, bool bMenuItem)
|
||||
: m_strName(str)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// these items will be set during the first invocation of the c'tor,
|
||||
// because the values will be determined by checking the system settings,
|
||||
// which is a chunk of code
|
||||
size_t wxOwnerDrawn::ms_nDefaultMarginWidth = 0;
|
||||
size_t wxOwnerDrawn::ms_nLastMarginWidth = 0;
|
||||
|
||||
|
||||
// drawing
|
||||
// -------
|
||||
|
||||
// get size of the item
|
||||
// The item size includes the menu string, the accel string,
|
||||
// the bitmap and size for a submenu expansion arrow...
|
||||
bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// draw the item
|
||||
bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
|
||||
const wxRect& rc,
|
||||
wxODAction act,
|
||||
wxODStatus st)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_OWNER_DRAWN
|
||||
|
||||
83
src/palmos/palette.cpp
Normal file
83
src/palmos/palette.cpp
Normal file
@@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palette.cpp
|
||||
// Purpose: wxPalette
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "palette.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/palette.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
|
||||
|
||||
/*
|
||||
* Palette
|
||||
*
|
||||
*/
|
||||
|
||||
wxPaletteRefData::wxPaletteRefData(void)
|
||||
{
|
||||
}
|
||||
|
||||
wxPaletteRefData::~wxPaletteRefData(void)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalette::wxPalette(void)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalette::~wxPalette(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPalette::FreeResource(bool WXUNUSED(force))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPalette::SetHPALETTE(WXHPALETTE pal)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
122
src/palmos/pen.cpp
Normal file
122
src/palmos/pen.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/pen.cpp
|
||||
// Purpose: wxPen
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "pen.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <stdio.h>
|
||||
#include "wx/setup.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/pen.h"
|
||||
#endif
|
||||
|
||||
static int wx2msPenStyle(int wx_style);
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
|
||||
|
||||
wxPenRefData::wxPenRefData()
|
||||
{
|
||||
}
|
||||
|
||||
wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||
{
|
||||
}
|
||||
|
||||
wxPenRefData::~wxPenRefData()
|
||||
{
|
||||
}
|
||||
|
||||
// Pens
|
||||
|
||||
wxPen::wxPen()
|
||||
{
|
||||
}
|
||||
|
||||
wxPen::~wxPen()
|
||||
{
|
||||
}
|
||||
|
||||
// Should implement Create
|
||||
wxPen::wxPen(const wxColour& col, int Width, int Style)
|
||||
{
|
||||
}
|
||||
|
||||
wxPen::wxPen(const wxBitmap& stipple, int Width)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPen::RealizeResource()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXHANDLE wxPen::GetResourceHandle() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxPen::FreeResource(bool WXUNUSED(force))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxPen::IsFree() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPen::Unshare()
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetColour(const wxColour& col)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetWidth(int Width)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetStyle(int Style)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetStipple(const wxBitmap& Stipple)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetJoin(int Join)
|
||||
{
|
||||
}
|
||||
|
||||
void wxPen::SetCap(int Cap)
|
||||
{
|
||||
}
|
||||
|
||||
72
src/palmos/popupwin.cpp
Normal file
72
src/palmos/popupwin.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/popupwin.cpp
|
||||
// Purpose: implements wxPopupWindow for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "popup.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/defs.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#if wxUSE_POPUPWIN
|
||||
|
||||
#include "wx/popupwin.h"
|
||||
|
||||
#include "wx/palmos/private.h" // for GetDesktopWindow()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPopupWindow, wxWindow)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
bool wxPopupWindow::Create(wxWindow *parent, int flags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPopupWindow::DoGetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
WXDWORD wxPopupWindow::MSWGetStyle(long flags, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
WXHWND wxPopupWindow::MSWGetParent() const
|
||||
{
|
||||
return (WXHWND) 0;
|
||||
}
|
||||
|
||||
bool wxPopupWindow::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // #if wxUSE_POPUPWIN
|
||||
|
||||
117
src/palmos/printdlg.cpp
Normal file
117
src/palmos/printdlg.cpp
Normal file
@@ -0,0 +1,117 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printdlg.cpp
|
||||
// Purpose: wxPrintDialog, wxPageSetupDialog
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "printdlg.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// Don't use the Windows print dialog if we're in wxUniv mode and using
|
||||
// the PostScript architecture
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/dcprint.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
|
||||
IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxPrintDialog
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxPrintDialog::wxPrintDialog()
|
||||
{
|
||||
}
|
||||
|
||||
wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintDialogData* data)
|
||||
{
|
||||
}
|
||||
|
||||
wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPrintDialog::~wxPrintDialog()
|
||||
{
|
||||
}
|
||||
|
||||
int wxPrintDialog::ShowModal()
|
||||
{
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
wxDC *wxPrintDialog::GetPrintDC()
|
||||
{
|
||||
return (wxDC*) NULL;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxPageSetupDialog
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog()
|
||||
{
|
||||
}
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPageSetupDialog::~wxPageSetupDialog()
|
||||
{
|
||||
}
|
||||
|
||||
int wxPageSetupDialog::ShowModal()
|
||||
{
|
||||
return wxID_CANCEL;
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
130
src/palmos/printpalm.cpp
Normal file
130
src/palmos/printpalm.cpp
Normal file
@@ -0,0 +1,130 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printpalm.cpp
|
||||
// Purpose: wxPalmPrinter framework
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "printpalm.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
// Don't use the Windows printer if we're in wxUniv mode and using
|
||||
// the PostScript architecture
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && (!defined(__WXUNIVERSAL__) || !wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW)
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/window.h"
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/printpalm.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPalmPrinter, wxPrinterBase)
|
||||
IMPLEMENT_CLASS(wxPalmPrintPreview, wxPrintPreviewBase)
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Printer
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxPalmPrinter::wxPalmPrinter(wxPrintDialogData *data)
|
||||
: wxPrinterBase(data)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalmPrinter::~wxPalmPrinter()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPalmPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxDC* wxPalmPrinter::PrintDialog(wxWindow *parent)
|
||||
{
|
||||
wxDC* dc = (wxDC*) NULL;
|
||||
|
||||
return dc;
|
||||
}
|
||||
|
||||
bool wxPalmPrinter::Setup(wxWindow *parent)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Print preview
|
||||
*/
|
||||
|
||||
wxPalmPrintPreview::wxPalmPrintPreview(wxPrintout *printout,
|
||||
wxPrintout *printoutForPrinting,
|
||||
wxPrintDialogData *data)
|
||||
: wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalmPrintPreview::wxPalmPrintPreview(wxPrintout *printout,
|
||||
wxPrintout *printoutForPrinting,
|
||||
wxPrintData *data)
|
||||
: wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
{
|
||||
}
|
||||
|
||||
wxPalmPrintPreview::~wxPalmPrintPreview()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxPalmPrintPreview::Print(bool interactive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxPalmPrintPreview::DetermineScaling()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_PRINTING_ARCHITECTURE
|
||||
321
src/palmos/radiobox.cpp
Normal file
321
src/palmos/radiobox.cpp
Normal file
@@ -0,0 +1,321 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/radiobox.cpp
|
||||
// Purpose: wxRadioBox implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "radiobox.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/radiobox.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
#include "wx/tooltip.h"
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// TODO: wxCONSTRUCTOR
|
||||
#if 0 // wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxRadioBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxRadioBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxRA_SPECIFY_COLS)
|
||||
wxFLAGS_MEMBER(wxRA_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxRA_SPECIFY_ROWS)
|
||||
wxFLAGS_MEMBER(wxRA_VERTICAL)
|
||||
|
||||
wxEND_FLAGS( wxRadioBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox, wxControl,"wx/radiobox.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxRadioBox)
|
||||
wxEVENT_PROPERTY( Select , wxEVT_COMMAND_RADIOBOX_SELECTED , wxCommandEvent )
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxRadioBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
|
||||
#endif
|
||||
|
||||
/*
|
||||
selection
|
||||
content
|
||||
label
|
||||
dimension
|
||||
item
|
||||
*/
|
||||
|
||||
#define RADIOBTN_PARENT_IS_RADIOBOX 0
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// private functions
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global vars
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// the pointer to standard radio button wnd proc
|
||||
static WXFARPROC s_wndprocRadioBtn = (WXFARPROC)NULL;
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxRadioBox
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
int wxRadioBox::GetCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxRadioBox::GetColumnCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxRadioBox::GetRowCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// returns the number of rows
|
||||
int wxRadioBox::GetNumVer() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// returns the number of columns
|
||||
int wxRadioBox::GetNumHor() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Radio box item
|
||||
wxRadioBox::wxRadioBox()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n,
|
||||
const wxString choices[],
|
||||
int majorDim,
|
||||
long style,
|
||||
const wxValidator& val,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRadioBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
int majorDim,
|
||||
long style,
|
||||
const wxValidator& val,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxRadioBox::~wxRadioBox()
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SetString(int item, const wxString& label)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SetSelection(int N)
|
||||
{
|
||||
}
|
||||
|
||||
// Get single selection, for single choice list items
|
||||
int wxRadioBox::GetSelection() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Find string for position
|
||||
wxString wxRadioBox::GetString(int item) const
|
||||
{
|
||||
wxString ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// size calculations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxRadioBox::GetMaxButtonSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
wxSize wxRadioBox::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
// Restored old code.
|
||||
void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::GetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::GetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SetFocus()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Enable a specific button
|
||||
void wxRadioBox::Enable(int item, bool enable)
|
||||
{
|
||||
}
|
||||
|
||||
// Enable all controls
|
||||
bool wxRadioBox::Enable(bool enable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show a specific button
|
||||
void wxRadioBox::Show(int item, bool show)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxRadioBox::Command(wxCommandEvent & event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
|
||||
{
|
||||
}
|
||||
|
||||
void wxRadioBox::SendNotificationEvent()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioBox::SetFont(const wxFont& font)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// our window proc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXLRESULT wxRadioBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
|
||||
#if wxUSE_CTL3D
|
||||
WXUINT message,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam
|
||||
#else
|
||||
WXUINT WXUNUSED(message),
|
||||
WXWPARAM WXUNUSED(wParam),
|
||||
WXLPARAM WXUNUSED(lParam)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
return (WXHBRUSH)0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_RADIOBOX
|
||||
157
src/palmos/radiobut.cpp
Normal file
157
src/palmos/radiobut.cpp
Normal file
@@ -0,0 +1,157 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/radiobut.cpp
|
||||
// Purpose: wxRadioButton
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "radiobut.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_RADIOBTN
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/radiobut.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ============================================================================
|
||||
// wxRadioButton implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRadioButton creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxRadioButtonStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxRadioButtonStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxRB_GROUP)
|
||||
|
||||
wxEND_FLAGS( wxRadioButtonStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioButton, wxControl,"wx/radiobut.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxRadioButton)
|
||||
wxEVENT_PROPERTY( Click , wxEVT_COMMAND_RADIOBUTTON_SELECTED , wxCommandEvent )
|
||||
wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Value ,bool, SetValue, GetValue, EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxRadioButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxRadioButton)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxRadioButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
|
||||
#endif
|
||||
|
||||
|
||||
void wxRadioButton::Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioButton::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRadioButton functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxRadioButton::SetValue(bool value)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioButton::GetValue() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRadioButton event processing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxRadioButton::Command (wxCommandEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRadioButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRadioButton geometry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxRadioButton::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
#endif // wxUSE_RADIOBTN
|
||||
|
||||
207
src/palmos/regconf.cpp
Normal file
207
src/palmos/regconf.cpp
Normal file
@@ -0,0 +1,207 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/regconf.cpp
|
||||
// Purpose:
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "regconf.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"
|
||||
#include "wx/intl.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#if wxUSE_CONFIG
|
||||
|
||||
#include "wx/config.h"
|
||||
|
||||
#include "wx/palmos/registry.h"
|
||||
#include "wx/palmos/regconf.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we put our data in HKLM\SOFTWARE_KEY\appname
|
||||
#define SOFTWARE_KEY wxString(wxT("Software\\"))
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// get the value if the key is opened and it exists
|
||||
bool TryGetValue(const wxRegKey& key, const wxString& str, wxString& strVal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TryGetValue(const wxRegKey& key, const wxString& str, long *plVal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ctor/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// create the config object which stores its data under HKCU\vendor\app and, if
|
||||
// style & wxCONFIG_USE_GLOBAL_FILE, under HKLM\vendor\app
|
||||
wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName,
|
||||
const wxString& strLocal, const wxString& strGlobal,
|
||||
long style)
|
||||
: wxConfigBase(appName, vendorName, strLocal, strGlobal, style)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegConfig::~wxRegConfig()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// path management
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxRegConfig::SetPath(const wxString& strPath)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// enumeration (works only with current group)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define LOCAL_MASK 0x8000
|
||||
#define IS_LOCAL_INDEX(l) (((l) & LOCAL_MASK) != 0)
|
||||
|
||||
bool wxRegConfig::GetFirstGroup(wxString& str, long& lIndex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::GetNextGroup(wxString& str, long& lIndex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::GetFirstEntry(wxString& str, long& lIndex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::GetNextEntry(wxString& str, long& lIndex) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t wxRegConfig::GetNumberOfEntries(bool WXUNUSED(bRecursive)) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t wxRegConfig::GetNumberOfGroups(bool WXUNUSED(bRecursive)) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// tests for existence
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxRegConfig::HasGroup(const wxString& key) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::HasEntry(const wxString& key) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxConfigBase::EntryType wxRegConfig::GetEntryType(const wxString& key) const
|
||||
{
|
||||
return wxConfigBase::Type_Integer;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// reading/writing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// this exactly reproduces the string version above except for ExpandEnvVars(),
|
||||
// we really should avoid this code duplication somehow...
|
||||
|
||||
bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DoWriteString(const wxString& key, const wxString& szValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DoWriteLong(const wxString& key, long lValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// renaming
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxRegConfig::RenameEntry(const wxString& oldName, const wxString& newName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// deleting
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DeleteGroup(const wxString& key)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegConfig::DeleteAll()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_CONFIG
|
||||
243
src/palmos/region.cpp
Normal file
243
src/palmos/region.cpp
Normal file
@@ -0,0 +1,243 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/region.cpp
|
||||
// Purpose: wxRegion implementation
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "region.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/region.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionRefData implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// wxRegion implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// ctors and dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxRegion::wxRegion()
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(WXHRGN hRegion)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(const wxRect& rect)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::wxRegion(size_t n, const wxPoint *points, int fillStyle)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegion::~wxRegion()
|
||||
{
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CreateRefData() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Clear current region
|
||||
void wxRegion::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxRegion::Offset(wxCoord x, wxCoord y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// combine another region with this one
|
||||
bool wxRegion::Combine(const wxRegion& rgn, wxRegionOp op)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Combine rectangle (x, y, w, h) with this.
|
||||
bool wxRegion::Combine(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height,
|
||||
wxRegionOp op)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxRegion::Combine(const wxRect& rect, wxRegionOp op)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion bounding box
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Outer bounds of region
|
||||
void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const
|
||||
{
|
||||
}
|
||||
|
||||
wxRect wxRegion::GetBox() const
|
||||
{
|
||||
return wxRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Is region empty?
|
||||
bool wxRegion::Empty() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegion hit testing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Does the region contain the point (x,y)?
|
||||
wxRegionContain wxRegion::Contains(wxCoord x, wxCoord y) const
|
||||
{
|
||||
return wxOutRegion;
|
||||
}
|
||||
|
||||
// Does the region contain the point pt?
|
||||
wxRegionContain wxRegion::Contains(const wxPoint& pt) const
|
||||
{
|
||||
return wxOutRegion;
|
||||
}
|
||||
|
||||
// Does the region contain the rectangle (x, y, w, h)?
|
||||
wxRegionContain wxRegion::Contains(wxCoord x, wxCoord y,
|
||||
wxCoord w, wxCoord h) const
|
||||
{
|
||||
return wxOutRegion;
|
||||
}
|
||||
|
||||
// Does the region contain the rectangle rect
|
||||
wxRegionContain wxRegion::Contains(const wxRect& rect) const
|
||||
{
|
||||
return wxOutRegion;
|
||||
}
|
||||
|
||||
// Get internal region handle
|
||||
WXHRGN wxRegion::GetHRGN() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// wxRegionIterator implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator ctors/dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxRegionIterator::Init()
|
||||
{
|
||||
}
|
||||
|
||||
wxRegionIterator::~wxRegionIterator()
|
||||
{
|
||||
}
|
||||
|
||||
// Initialize iterator for region
|
||||
wxRegionIterator::wxRegionIterator(const wxRegion& region)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& ri)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Reset iterator for a new region.
|
||||
void wxRegionIterator::Reset(const wxRegion& region)
|
||||
{
|
||||
}
|
||||
|
||||
wxRegionIterator& wxRegionIterator::operator++()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxRegionIterator wxRegionIterator::operator ++ (int)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRegionIterator accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxCoord wxRegionIterator::GetX() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxRegionIterator::GetY() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxRegionIterator::GetW() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxCoord wxRegionIterator::GetH() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
1027
src/palmos/registry.cpp
Normal file
1027
src/palmos/registry.cpp
Normal file
File diff suppressed because it is too large
Load Diff
191
src/palmos/renderer.cpp
Normal file
191
src/palmos/renderer.cpp
Normal file
@@ -0,0 +1,191 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/renderer.cpp
|
||||
// Purpose: implementation of wxRendererNative for Palm OS
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 20.07.2003
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// License: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Palm OS doesn't really have a theme engine, so this is not needed.
|
||||
#ifndef __PALMOS__
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/dc.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/splitter.h"
|
||||
#include "wx/renderer.h"
|
||||
|
||||
#include "wx/palmos/uxtheme.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRendererMSW: wxRendererNative implementation for "old" Win32 systems
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxRendererMSW : public wxDelegateRendererNative
|
||||
{
|
||||
public:
|
||||
wxRendererMSW() { }
|
||||
|
||||
static wxRendererNative& Get();
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxRendererMSW)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRendererXP: wxRendererNative implementation for Windows XP and later
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxRendererXP : public wxDelegateRendererNative
|
||||
{
|
||||
public:
|
||||
wxRendererXP() : wxDelegateRendererNative(wxRendererMSW::Get()) { }
|
||||
|
||||
static wxRendererNative& Get();
|
||||
|
||||
virtual void DrawSplitterBorder(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int flags = 0);
|
||||
virtual void DrawSplitterSash(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxSize& size,
|
||||
wxCoord position,
|
||||
wxOrientation orient,
|
||||
int flags = 0);
|
||||
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxRendererXP)
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// wxRendererNative and wxRendererMSW implementation
|
||||
// ============================================================================
|
||||
|
||||
/* static */
|
||||
wxRendererNative& wxRendererNative::GetDefault()
|
||||
{
|
||||
wxUxThemeEngine *themeEngine = wxUxThemeEngine::Get();
|
||||
return themeEngine && themeEngine->IsAppThemed() ? wxRendererXP::Get()
|
||||
: wxRendererMSW::Get();
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxRendererNative& wxRendererMSW::Get()
|
||||
{
|
||||
static wxRendererMSW s_rendererMSW;
|
||||
|
||||
return s_rendererMSW;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// wxRendererXP implementation
|
||||
// ============================================================================
|
||||
|
||||
/* static */
|
||||
wxRendererNative& wxRendererXP::Get()
|
||||
{
|
||||
static wxRendererXP s_rendererXP;
|
||||
|
||||
return s_rendererXP;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// splitter drawing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the width of the sash: this is the same as used by Explorer...
|
||||
static const wxCoord SASH_WIDTH = 4;
|
||||
|
||||
wxSplitterRenderParams
|
||||
wxRendererXP::GetSplitterParams(const wxWindow * win)
|
||||
{
|
||||
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||
return m_rendererNative.GetSplitterParams(win);
|
||||
else
|
||||
return wxSplitterRenderParams(SASH_WIDTH, 0, false);
|
||||
}
|
||||
|
||||
void
|
||||
wxRendererXP::DrawSplitterBorder(wxWindow * win,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int flags)
|
||||
{
|
||||
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||
{
|
||||
m_rendererNative.DrawSplitterBorder(win, dc, rect, flags);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
wxRendererXP::DrawSplitterSash(wxWindow *win,
|
||||
wxDC& dc,
|
||||
const wxSize& size,
|
||||
wxCoord position,
|
||||
wxOrientation orient,
|
||||
int flags)
|
||||
{
|
||||
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||
{
|
||||
m_rendererNative.DrawSplitterSash(
|
||||
win, dc, size, position, orient, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
// I don't know if it is correct to use the rebar background for the
|
||||
// splitter but it least this works ok in the default theme
|
||||
wxUxThemeHandle hTheme(win, L"REBAR");
|
||||
if ( hTheme )
|
||||
{
|
||||
RECT rect;
|
||||
if ( orient == wxVERTICAL )
|
||||
{
|
||||
rect.left = position;
|
||||
rect.right = position + SASH_WIDTH;
|
||||
rect.top = 0;
|
||||
rect.bottom = size.y;
|
||||
}
|
||||
else // wxHORIZONTAL
|
||||
{
|
||||
rect.left = 0;
|
||||
rect.right = size.x;
|
||||
rect.top = position;
|
||||
rect.bottom = position + SASH_WIDTH;
|
||||
}
|
||||
|
||||
wxUxThemeEngine::Get()->DrawThemeBackground
|
||||
(
|
||||
(WXHTHEME)hTheme,
|
||||
dc.GetHDC(),
|
||||
3 /* RP_BAND */,
|
||||
0 /* no state */ ,
|
||||
&rect,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
138
src/palmos/scrolbar.cpp
Normal file
138
src/palmos/scrolbar.cpp
Normal file
@@ -0,0 +1,138 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/scrolbar.cpp
|
||||
// Purpose: wxScrollBar
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "scrolbar.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_SCROLLBAR
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#endif
|
||||
|
||||
#include "wx/scrolbar.h"
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxScrollBarStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxScrollBarStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxSB_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxSB_VERTICAL)
|
||||
|
||||
wxEND_FLAGS( wxScrollBarStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl,"wx/scrolbar.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxScrollBar)
|
||||
wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent )
|
||||
|
||||
wxPROPERTY( ThumbPosition , int , SetThumbPosition, GetThumbPosition, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( ThumbSize , int , SetThumbSize, GetThumbSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( PageSize , int , SetPageSize, GetPageSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxScrollBarStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxScrollBar)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxScrollBar , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
||||
#endif
|
||||
|
||||
// Scrollbar
|
||||
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& wxVALIDATOR_PARAM(validator),
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxScrollBar::~wxScrollBar(void)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
WXWORD pos, WXHWND WXUNUSED(control))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxScrollBar::SetThumbPosition(int viewStart)
|
||||
{
|
||||
}
|
||||
|
||||
int wxScrollBar::GetThumbPosition(void) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||
bool refresh)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
|
||||
WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxScrollBar::Command(wxCommandEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxScrollBar::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
#endif // wxUSE_SCROLLBAR
|
||||
113
src/palmos/settings.cpp
Normal file
113
src/palmos/settings.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/settings.cpp
|
||||
// Purpose: wxSystemSettingsNative implementation for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/settings.h"
|
||||
|
||||
#ifndef SPI_GETFLATMENU
|
||||
#define SPI_GETFLATMENU 0x1022
|
||||
#endif
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/fontutil.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the font returned by GetFont(wxSYS_DEFAULT_GUI_FONT): it is created when
|
||||
// GetFont() is called for the first time and deleted by wxSystemSettingsModule
|
||||
static wxFont *gs_fontDefault = NULL;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSystemSettingsNative
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// colours
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
|
||||
{
|
||||
return wxNullColour;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// fonts
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxFont wxCreateFontFromStockObject(int index)
|
||||
{
|
||||
wxFont font;
|
||||
return font;
|
||||
}
|
||||
|
||||
wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
{
|
||||
wxFont font;
|
||||
return font;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// system metrics/features
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
int wxSystemSettingsNative::GetMetric(wxSystemMetric index)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// function from wx/msw/wrapcctl.h: there is really no other place for it...
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LISTCTRL || wxUSE_TREECTRL
|
||||
|
||||
extern wxFont wxGetCCDefaultFont()
|
||||
{
|
||||
wxFont font;
|
||||
return font;
|
||||
}
|
||||
|
||||
#endif // wxUSE_LISTCTRL || wxUSE_TREECTRL
|
||||
235
src/palmos/slider.cpp
Normal file
235
src/palmos/slider.cpp
Normal file
@@ -0,0 +1,235 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: slider.cpp
|
||||
// Purpose: wxSlider
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "slider.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/utils.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/slider.h"
|
||||
#endif
|
||||
|
||||
#include "wx/palmos/slider.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxSliderStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxSliderStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxSL_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxSL_VERTICAL)
|
||||
wxFLAGS_MEMBER(wxSL_AUTOTICKS)
|
||||
wxFLAGS_MEMBER(wxSL_LABELS)
|
||||
wxFLAGS_MEMBER(wxSL_LEFT)
|
||||
wxFLAGS_MEMBER(wxSL_TOP)
|
||||
wxFLAGS_MEMBER(wxSL_RIGHT)
|
||||
wxFLAGS_MEMBER(wxSL_BOTTOM)
|
||||
wxFLAGS_MEMBER(wxSL_BOTH)
|
||||
wxFLAGS_MEMBER(wxSL_SELRANGE)
|
||||
|
||||
wxEND_FLAGS( wxSliderStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl,"wx/scrolbar.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxSlider)
|
||||
wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent )
|
||||
wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SLIDER_UPDATED , wxCommandEvent )
|
||||
|
||||
wxPROPERTY( Value , int , SetValue, GetValue , 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Minimum , int , SetMin, GetMin, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Maximum , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( PageSize , int , SetPageSize, GetLineSize, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( LineSize , int , SetLineSize, GetLineSize, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( ThumbLength , int , SetThumbLength, GetThumbLength, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxSliderStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxSlider)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_8( wxSlider , wxWindow* , Parent , wxWindowID , Id , int , Value , int , Minimum , int , Maximum , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
|
||||
#endif
|
||||
|
||||
// Slider
|
||||
wxSlider::wxSlider()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size, long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSlider::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
WXWORD WXUNUSED(pos), WXHWND control)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSlider::~wxSlider()
|
||||
{
|
||||
}
|
||||
|
||||
int wxSlider::GetValue() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSlider::SetValue(int value)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::DoGetSize(int *width, int *height) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::GetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
wxSize wxSlider::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
|
||||
void wxSlider::SetRange(int minValue, int maxValue)
|
||||
{
|
||||
}
|
||||
|
||||
WXHBRUSH wxSlider::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSlider::SetTickFreq(int n, int pos)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::SetPageSize(int pageSize)
|
||||
{
|
||||
}
|
||||
|
||||
int wxSlider::GetPageSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSlider::ClearSel()
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::ClearTicks()
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::SetLineSize(int lineSize)
|
||||
{
|
||||
}
|
||||
|
||||
int wxSlider::GetLineSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxSlider::GetSelEnd() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxSlider::GetSelStart() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSlider::SetSelection(int minPos, int maxPos)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSlider::SetThumbLength(int len)
|
||||
{
|
||||
}
|
||||
|
||||
int wxSlider::GetThumbLength() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSlider::SetTick(int tickPos)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSlider::ContainsHWND(WXHWND hWnd) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxSlider::Command (wxCommandEvent & event)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSlider::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_SLIDER
|
||||
97
src/palmos/snglinst.cpp
Normal file
97
src/palmos/snglinst.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/snglinst.cpp
|
||||
// Purpose: implements wxSingleInstanceChecker class for Win32 using
|
||||
// named mutexes
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "snglinst.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_SNGLINST_CHECKER
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/string.h"
|
||||
#include "wx/log.h"
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/snglinst.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSingleInstanceCheckerImpl: the real implementation class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxSingleInstanceCheckerImpl
|
||||
{
|
||||
public:
|
||||
wxSingleInstanceCheckerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
bool Create(const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WasOpened() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
~wxSingleInstanceCheckerImpl()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
// the result of the CreateMutex() call
|
||||
bool m_wasOpened;
|
||||
|
||||
// the mutex handle, may be NULL
|
||||
HANDLE m_hMutex;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxSingleInstanceCheckerImpl)
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// wxSingleInstanceChecker implementation
|
||||
// ============================================================================
|
||||
|
||||
bool wxSingleInstanceChecker::Create(const wxString& name,
|
||||
const wxString& WXUNUSED(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSingleInstanceChecker::IsAnotherRunning() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSingleInstanceChecker::~wxSingleInstanceChecker()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_SNGLINST_CHECKER
|
||||
76
src/palmos/sound.cpp
Normal file
76
src/palmos/sound.cpp
Normal file
@@ -0,0 +1,76 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: sound.cpp
|
||||
// Purpose: wxSound
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "sound.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_SOUND
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/file.h"
|
||||
#include "wx/sound.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
wxSound::wxSound()
|
||||
: m_waveData(NULL), m_waveLength(0), m_isResource(false)
|
||||
{
|
||||
}
|
||||
|
||||
wxSound::wxSound(const wxString& sFileName, bool isResource)
|
||||
: m_waveData(NULL), m_waveLength(0), m_isResource(isResource)
|
||||
{
|
||||
}
|
||||
|
||||
wxSound::wxSound(int size, const wxByte* data)
|
||||
: m_waveData(NULL), m_waveLength(0), m_isResource(false)
|
||||
{
|
||||
}
|
||||
|
||||
wxSound::~wxSound()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSound::Create(const wxString& fileName, bool isResource)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSound::Create(int size, const wxByte* data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSound::DoPlay(unsigned flags) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSound::Free()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*static*/ void wxSound::Stop()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_SOUND
|
||||
178
src/palmos/spinbutt.cpp
Normal file
178
src/palmos/spinbutt.cpp
Normal file
@@ -0,0 +1,178 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/spinbutt.cpp
|
||||
// Purpose: wxSpinButton
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "spinbutt.h"
|
||||
#pragma implementation "spinbutbase.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
|
||||
#include "wx/spinbutt.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
|
||||
|
||||
#if defined(__WIN95__)
|
||||
|
||||
#include "wx/msw/private.h"
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxSpinButtonStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxSpinButtonStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxSP_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxSP_VERTICAL)
|
||||
wxFLAGS_MEMBER(wxSP_ARROW_KEYS)
|
||||
wxFLAGS_MEMBER(wxSP_WRAP)
|
||||
|
||||
wxEND_FLAGS( wxSpinButtonStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinButton, wxControl,"wx/spinbut.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxSpinButton)
|
||||
wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent )
|
||||
|
||||
wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Min , int , SetMin, GetMin, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxSpinButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxSpinButton)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxSpinButton , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinButton
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxSpinButton::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSpinButton::~wxSpinButton()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// size calculation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxSpinButton::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0),
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Attributes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxSpinButton::GetValue() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSpinButton::SetValue(int val)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSpinButton::SetRange(int minVal, int maxVal)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
|
||||
WXWORD pos, WXHWND control)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSpinButton::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // __WIN95__
|
||||
|
||||
#endif
|
||||
// wxUSE_SPINCTN
|
||||
|
||||
251
src/palmos/spinctrl.cpp
Normal file
251
src/palmos/spinctrl.cpp
Normal file
@@ -0,0 +1,251 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/spinctrl.cpp
|
||||
// Purpose: wxSpinCtrl class implementation for Palm OS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "spinctrlbase.h"
|
||||
#pragma implementation "spinctrl.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
|
||||
#if defined(__WIN95__)
|
||||
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxSpinCtrlStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxSpinCtrlStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxSP_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxSP_VERTICAL)
|
||||
wxFLAGS_MEMBER(wxSP_ARROW_KEYS)
|
||||
wxFLAGS_MEMBER(wxSP_WRAP)
|
||||
|
||||
wxEND_FLAGS( wxSpinCtrlStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinCtrl, wxControl,"wx/spinbut.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxSpinCtrl)
|
||||
wxEVENT_RANGE_PROPERTY( Spin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent )
|
||||
wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SPINCTRL_UPDATED , wxCommandEvent )
|
||||
wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent )
|
||||
wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent )
|
||||
|
||||
wxPROPERTY( ValueString , wxString , SetValue , GetValue , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) ;
|
||||
wxPROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY( Min , int , SetMin, GetMin, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
|
||||
wxPROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxSpinCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
/*
|
||||
TODO PROPERTIES
|
||||
style wxSP_ARROW_KEYS
|
||||
*/
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxSpinCtrl)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxSpinCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , ValueString , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
|
||||
#endif
|
||||
|
||||
BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton)
|
||||
EVT_CHAR(wxSpinCtrl::OnChar)
|
||||
|
||||
EVT_SET_FOCUS(wxSpinCtrl::OnSetFocus)
|
||||
|
||||
EVT_SPIN(-1, wxSpinCtrl::OnSpinChange)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#define GetBuddyHwnd() (HWND)(m_hwndBuddy)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the margin between the up-down control and its buddy (can be arbitrary,
|
||||
// choose what you like - or may be decide during run-time depending on the
|
||||
// font size?)
|
||||
static const int MARGIN_BETWEEN = 1;
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
wxArraySpins wxSpinCtrl::ms_allSpins;
|
||||
|
||||
/* static */
|
||||
wxSpinCtrl *wxSpinCtrl::GetSpinForTextCtrl(WXHWND hwndBuddy)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// process a WM_COMMAND generated by the buddy text control
|
||||
bool wxSpinCtrl::ProcessTextCommand(WXWORD cmd, WXWORD WXUNUSED(id))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
void wxSpinCtrl::OnSetFocus(wxFocusEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// construction
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxSpinCtrl::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
int min, int max, int initial,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSpinCtrl::~wxSpinCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl-like methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxSpinCtrl::SetValue(const wxString& text)
|
||||
{
|
||||
}
|
||||
|
||||
int wxSpinCtrl::GetValue() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetSelection(long from, long to)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward some methods to subcontrols
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxSpinCtrl::SetFont(const wxFont& font)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSpinCtrl::Show(bool show)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxSpinCtrl::Enable(bool enable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetFocus()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event processing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxSpinCtrl::OnSpinChange(wxSpinEvent& eventSpin)
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// size calculations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxSize wxSpinCtrl::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
// get total size of the control
|
||||
void wxSpinCtrl::DoGetSize(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxSpinCtrl::DoGetPosition(int *x, int *y) const
|
||||
{
|
||||
}
|
||||
|
||||
#endif // __WIN95__
|
||||
|
||||
#endif
|
||||
// wxUSE_SPINCTRL
|
||||
|
||||
162
src/palmos/statbmp.cpp
Normal file
162
src/palmos/statbmp.cpp
Normal file
@@ -0,0 +1,162 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbmp.cpp
|
||||
// Purpose: wxStaticBitmap
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ===========================================================================
|
||||
// declarations
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "statbmp.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATBMP
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/icon.h"
|
||||
#include "wx/statbmp.h"
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// macors
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxStaticBitmapStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxStaticBitmapStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxEND_FLAGS( wxStaticBitmapStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBitmap, wxControl,"wx/statbmp.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxStaticBitmap)
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxStaticBitmapStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxStaticBitmap)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxStaticBitmap, wxWindow* , Parent , wxWindowID , Id , wxBitmap, Bitmap, wxPoint , Position , wxSize , Size )
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
||||
#endif
|
||||
|
||||
/*
|
||||
TODO PROPERTIES :
|
||||
bitmap
|
||||
*/
|
||||
|
||||
// ===========================================================================
|
||||
// implementation
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxStaticBitmap
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
static wxGDIImage* ConvertImage( const wxGDIImage& bitmap )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool wxStaticBitmap::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxGDIImage& bitmap,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxBorder wxStaticBitmap::GetDefaultBorder() const
|
||||
{
|
||||
return wxBORDER_NONE;
|
||||
}
|
||||
|
||||
WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool wxStaticBitmap::ImageIsOk() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxStaticBitmap::Free()
|
||||
{
|
||||
}
|
||||
|
||||
wxSize wxStaticBitmap::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxStaticBitmap::SetImage( const wxGDIImage* image )
|
||||
{
|
||||
}
|
||||
|
||||
void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
|
||||
{
|
||||
}
|
||||
|
||||
// We need this or the control can never be moved e.g. in Dialog Editor.
|
||||
WXLRESULT wxStaticBitmap::MSWWindowProc(WXUINT nMsg,
|
||||
WXWPARAM wParam,
|
||||
WXLPARAM lParam)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_STATBMP
|
||||
127
src/palmos/statbox.cpp
Normal file
127
src/palmos/statbox.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/statbox.cpp
|
||||
// Purpose: wxStaticBox
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "statbox.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/app.h"
|
||||
#include "wx/dcclient.h"
|
||||
#endif
|
||||
|
||||
#include "wx/statbox.h"
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWin macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxStaticBoxStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxStaticBoxStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxEND_FLAGS( wxStaticBoxStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticBox, wxControl,"wx/statbox.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxStaticBox)
|
||||
wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxStaticBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
/*
|
||||
TODO PROPERTIES :
|
||||
label
|
||||
*/
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxStaticBox)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxStaticBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticBox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxStaticBox::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxSize wxStaticBox::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_STATBOX
|
||||
126
src/palmos/statline.cpp
Normal file
126
src/palmos/statline.cpp
Normal file
@@ -0,0 +1,126 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/statline.cpp
|
||||
// Purpose: wxStaticLine class
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "statline.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include "wx/statline.h"
|
||||
|
||||
#if wxUSE_STATLINE
|
||||
|
||||
#include "wx/palmos/private.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#ifndef SS_SUNKEN
|
||||
#define SS_SUNKEN 0x00001000L
|
||||
#endif
|
||||
|
||||
#ifndef SS_NOTIFY
|
||||
#define SS_NOTIFY 0x00000100L
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxStaticLineStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxStaticLineStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxLI_HORIZONTAL)
|
||||
wxFLAGS_MEMBER(wxLI_VERTICAL)
|
||||
|
||||
wxEND_FLAGS( wxStaticLineStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticLine, wxControl,"wx/statline.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxStaticLine)
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxStaticLineStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxStaticLine)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_5( wxStaticLine, wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle)
|
||||
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticLine, wxControl)
|
||||
#endif
|
||||
|
||||
/*
|
||||
TODO PROPERTIES :
|
||||
style (wxLI_HORIZONTAL)
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticLine
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxStaticLine::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& sizeOrig,
|
||||
long style,
|
||||
const wxString &name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // wxUSE_STATLINE
|
||||
|
||||
127
src/palmos/stattext.cpp
Normal file
127
src/palmos/stattext.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/palmos/stattext.cpp
|
||||
// Purpose: wxStaticText
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "stattext.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATTEXT
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/brush.h"
|
||||
#endif
|
||||
|
||||
#include "wx/stattext.h"
|
||||
#include "wx/palmos/private.h"
|
||||
|
||||
#if wxUSE_EXTENDED_RTTI
|
||||
WX_DEFINE_FLAGS( wxStaticTextStyle )
|
||||
|
||||
wxBEGIN_FLAGS( wxStaticTextStyle )
|
||||
// new style border flags, we put them first to
|
||||
// use them for streaming out
|
||||
wxFLAGS_MEMBER(wxBORDER_SIMPLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_SUNKEN)
|
||||
wxFLAGS_MEMBER(wxBORDER_DOUBLE)
|
||||
wxFLAGS_MEMBER(wxBORDER_RAISED)
|
||||
wxFLAGS_MEMBER(wxBORDER_STATIC)
|
||||
wxFLAGS_MEMBER(wxBORDER_NONE)
|
||||
|
||||
// old style border flags
|
||||
wxFLAGS_MEMBER(wxSIMPLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxSUNKEN_BORDER)
|
||||
wxFLAGS_MEMBER(wxDOUBLE_BORDER)
|
||||
wxFLAGS_MEMBER(wxRAISED_BORDER)
|
||||
wxFLAGS_MEMBER(wxSTATIC_BORDER)
|
||||
wxFLAGS_MEMBER(wxBORDER)
|
||||
|
||||
// standard window styles
|
||||
wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
|
||||
wxFLAGS_MEMBER(wxCLIP_CHILDREN)
|
||||
wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
|
||||
wxFLAGS_MEMBER(wxWANTS_CHARS)
|
||||
wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
|
||||
wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
|
||||
wxFLAGS_MEMBER(wxVSCROLL)
|
||||
wxFLAGS_MEMBER(wxHSCROLL)
|
||||
|
||||
wxFLAGS_MEMBER(wxST_NO_AUTORESIZE)
|
||||
wxFLAGS_MEMBER(wxALIGN_LEFT)
|
||||
wxFLAGS_MEMBER(wxALIGN_RIGHT)
|
||||
wxFLAGS_MEMBER(wxALIGN_CENTRE)
|
||||
|
||||
wxEND_FLAGS( wxStaticTextStyle )
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText, wxControl,"wx/stattext.h")
|
||||
|
||||
wxBEGIN_PROPERTIES_TABLE(wxStaticText)
|
||||
wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
|
||||
wxPROPERTY_FLAGS( WindowStyle , wxStaticTextStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
|
||||
wxEND_PROPERTIES_TABLE()
|
||||
|
||||
wxBEGIN_HANDLERS_TABLE(wxStaticText)
|
||||
wxEND_HANDLERS_TABLE()
|
||||
|
||||
wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
|
||||
#else
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
|
||||
#endif
|
||||
|
||||
bool wxStaticText::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxBorder wxStaticText::GetDefaultBorder() const
|
||||
{
|
||||
return wxBORDER_NONE;
|
||||
}
|
||||
|
||||
WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxSize wxStaticText::DoGetBestSize() const
|
||||
{
|
||||
return wxSize(0,0);
|
||||
}
|
||||
|
||||
void wxStaticText::DoSetSize(int x, int y, int w, int h, int sizeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
void wxStaticText::SetLabel(const wxString& label)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool wxStaticText::SetFont(const wxFont& font)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // wxUSE_STATTEXT
|
||||
250
src/palmos/statusbr.cpp
Normal file
250
src/palmos/statusbr.cpp
Normal file
@@ -0,0 +1,250 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palmos/statusbr.cpp
|
||||
// Purpose: Implementation of wxStatusBar for PalmOS
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "statusbr.h"
|
||||
#endif
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/setup.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dcclient.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/statusbr.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStatusBarPalm class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxStatusBarPalm::wxStatusBarPalm()
|
||||
{
|
||||
SetParent(NULL);
|
||||
m_hWnd = 0;
|
||||
m_windowId = 0;
|
||||
}
|
||||
|
||||
bool wxStatusBarPalm::Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
wxCHECK_MSG( parent, FALSE, wxT("status bar must have a parent") );
|
||||
|
||||
StatusTextBuffer = NULL;
|
||||
|
||||
SetName(name);
|
||||
SetParent(parent);
|
||||
|
||||
parent->AddChild(this);
|
||||
|
||||
m_windowId = id == -1 ? NewControlId() : id;
|
||||
|
||||
SetFieldsCount(1);
|
||||
SubclassWin(m_hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
wxStatusBarPalm::~wxStatusBarPalm()
|
||||
{
|
||||
DeleteStatusBuffer();
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths)
|
||||
{
|
||||
// this is a Windows limitation
|
||||
wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") );
|
||||
|
||||
wxStatusBarBase::SetFieldsCount(nFields, widths);
|
||||
|
||||
SetFieldsWidth();
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetStatusWidths(int n, const int widths[])
|
||||
{
|
||||
wxStatusBarBase::SetStatusWidths(n, widths);
|
||||
|
||||
SetFieldsWidth();
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetFieldsWidth()
|
||||
{
|
||||
// clear the status bar
|
||||
DeleteStatusBuffer();
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField)
|
||||
{
|
||||
wxCHECK_RET( (nField >= 0) && (nField < m_nFields),
|
||||
_T("invalid statusbar field index") );
|
||||
|
||||
SetStatusBufferText(strText,nField);
|
||||
DrawStatusBar();
|
||||
}
|
||||
|
||||
wxString wxStatusBarPalm::GetStatusText(int nField) const
|
||||
{
|
||||
wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString,
|
||||
_T("invalid statusbar field index") );
|
||||
|
||||
wxString text;
|
||||
return text;
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::DrawStatusBar()
|
||||
{
|
||||
int i=0;
|
||||
int leftPos=0;
|
||||
wxArrayInt widthsAbs;
|
||||
wxString text;
|
||||
|
||||
RectangleType EraseRect;
|
||||
EraseRect.topLeft.x=0;
|
||||
EraseRect.topLeft.y=160-FntCharHeight()-1;
|
||||
EraseRect.extent.x=159;
|
||||
EraseRect.extent.y=159;
|
||||
WinEraseRectangle(&EraseRect,0);
|
||||
|
||||
if(m_nFields>0)
|
||||
widthsAbs=CalculateAbsWidths(160 - 2*(m_nFields - 1));
|
||||
|
||||
for(i=0;i<m_nFields;i++)
|
||||
{
|
||||
text=GetStatusBufferText(i);
|
||||
WinDrawTruncChars(text,StrLen(text),leftPos,160-FntCharHeight(),widthsAbs[i]);
|
||||
leftPos+=widthsAbs[i]+2;
|
||||
}
|
||||
WinDrawLine(0,160-FntCharHeight()-1,159,160-FntCharHeight()-1);
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetStatusBufferText(const wxString& text, int number)
|
||||
{
|
||||
wxListString* st = GetOrCreateStatusBuffer(number);
|
||||
|
||||
wxString tmp1(text);
|
||||
wxString* tmp = new wxString(tmp1);
|
||||
st->Insert(tmp);
|
||||
}
|
||||
|
||||
wxString wxStatusBarPalm::GetStatusBufferText(int number)
|
||||
{
|
||||
wxListString *st = GetStatusBufferStack(number);
|
||||
if(st==0)
|
||||
return "";
|
||||
|
||||
wxListString::compatibility_iterator top = st->GetFirst();
|
||||
return(*top->GetData());
|
||||
}
|
||||
|
||||
wxListString *wxStatusBarPalm::GetOrCreateStatusBuffer(int i)
|
||||
{
|
||||
if(!StatusTextBuffer)
|
||||
{
|
||||
StatusTextBuffer = new wxListString*[m_nFields];
|
||||
|
||||
size_t j;
|
||||
for(j = 0; j < (size_t)m_nFields; ++j) StatusTextBuffer[j] = 0;
|
||||
}
|
||||
|
||||
if(!StatusTextBuffer[i])
|
||||
{
|
||||
StatusTextBuffer[i] = new wxListString();
|
||||
}
|
||||
else
|
||||
{
|
||||
wxListString *st=StatusTextBuffer[i];
|
||||
wxListString::compatibility_iterator top = st->GetFirst();
|
||||
delete top->GetData();
|
||||
st->Erase(top);
|
||||
delete st;
|
||||
|
||||
StatusTextBuffer[i] = new wxListString();
|
||||
}
|
||||
|
||||
return StatusTextBuffer[i];
|
||||
}
|
||||
|
||||
wxListString *wxStatusBarPalm::GetStatusBufferStack(int i) const
|
||||
{
|
||||
if(!StatusTextBuffer)
|
||||
return 0;
|
||||
return StatusTextBuffer[i];
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::DeleteStatusBuffer()
|
||||
{
|
||||
int i=0;
|
||||
|
||||
if(!StatusTextBuffer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(i=0;i<m_nFields;i++)
|
||||
{
|
||||
if(StatusTextBuffer[i])
|
||||
{
|
||||
wxListString *st=StatusTextBuffer[i];
|
||||
wxListString::compatibility_iterator top = st->GetFirst();
|
||||
delete top->GetData();
|
||||
st->Erase(top);
|
||||
delete st;
|
||||
StatusTextBuffer[i]=0;
|
||||
}
|
||||
}
|
||||
delete[] m_statusTextStacks;
|
||||
}
|
||||
|
||||
int wxStatusBarPalm::GetBorderX() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wxStatusBarPalm::GetBorderY() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::SetMinHeight(int height)
|
||||
{
|
||||
}
|
||||
|
||||
bool wxStatusBarPalm::GetFieldRect(int i, wxRect& rect) const
|
||||
{
|
||||
}
|
||||
|
||||
void wxStatusBarPalm::DoMoveWindow(int x, int y, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // wxUSE_NATIVE_STATUSBAR
|
||||
|
||||
189
src/palmos/tabctrl.cpp
Normal file
189
src/palmos/tabctrl.cpp
Normal file
@@ -0,0 +1,189 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.cpp
|
||||
// Purpose: wxTabCtrl
|
||||
// Author: William Osborne
|
||||
// Modified by:
|
||||
// Created: 10/13/04
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) William Osborne
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "tabctrl.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#if defined(__WIN95__)
|
||||
|
||||
#include "wx/tabctrl.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/palmos/imaglist.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxNotifyEvent)
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
|
||||
EVT_SYS_COLOUR_CHANGED(wxTabCtrl::OnSysColourChanged)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxTabCtrl::wxTabCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
wxTabCtrl::~wxTabCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Responds to colour changes, and passes event on to children.
|
||||
void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||
{
|
||||
}
|
||||
|
||||
// Delete all items
|
||||
bool wxTabCtrl::DeleteAllItems()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Delete an item
|
||||
bool wxTabCtrl::DeleteItem(int item)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the selection
|
||||
int wxTabCtrl::GetSelection() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the tab with the current keyboard focus
|
||||
int wxTabCtrl::GetCurFocus() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the associated image list
|
||||
wxImageList* wxTabCtrl::GetImageList() const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get the number of items
|
||||
int wxTabCtrl::GetItemCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the rect corresponding to the tab
|
||||
bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the number of rows
|
||||
int wxTabCtrl::GetRowCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get the item text
|
||||
wxString wxTabCtrl::GetItemText(int item) const
|
||||
{
|
||||
wxString str(wxEmptyString);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
// Get the item image
|
||||
int wxTabCtrl::GetItemImage(int item) const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get the item data
|
||||
void* wxTabCtrl::GetItemData(int item) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Hit test
|
||||
int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Insert an item
|
||||
bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the selection
|
||||
int wxTabCtrl::SetSelection(int item)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set the image list
|
||||
void wxTabCtrl::SetImageList(wxImageList* imageList)
|
||||
{
|
||||
}
|
||||
|
||||
// Set the text for an item
|
||||
bool wxTabCtrl::SetItemText(int item, const wxString& text)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the image for an item
|
||||
bool wxTabCtrl::SetItemImage(int item, int image)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the data for an item
|
||||
bool wxTabCtrl::SetItemData(int item, void* data)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the size for a fixed-width tab control
|
||||
void wxTabCtrl::SetItemSize(const wxSize& size)
|
||||
{
|
||||
}
|
||||
|
||||
// Set the padding between tabs
|
||||
void wxTabCtrl::SetPadding(const wxSize& padding)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
// __WIN95__
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user