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:
Julian Smart
2004-10-19 13:40:30 +00:00
parent 698b34facd
commit ffecfa5aeb
260 changed files with 40716 additions and 44 deletions

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