X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..815f65bd0f673965230ed915d794497a8818dd35:/src/palmos/textctrl.cpp diff --git a/src/palmos/textctrl.cpp b/src/palmos/textctrl.cpp index d6473c6d3c..40645d5f41 100644 --- a/src/palmos/textctrl.cpp +++ b/src/palmos/textctrl.cpp @@ -26,8 +26,9 @@ #if wxUSE_TEXTCTRL +#include "wx/textctrl.h" + #ifndef WX_PRECOMP - #include "wx/textctrl.h" #include "wx/settings.h" #include "wx/brush.h" #include "wx/utils.h" @@ -35,19 +36,15 @@ #include "wx/log.h" #include "wx/app.h" #include "wx/menu.h" + #include "wx/module.h" #endif -#include "wx/module.h" - #if wxUSE_CLIPBOARD #include "wx/clipbrd.h" #endif #include "wx/textfile.h" -#include "wx/palmos/private.h" -#include "wx/palmos/winundef.h" - #include #if wxUSE_RICHEDIT @@ -89,77 +86,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxRichEditModule, wxModule) // event tables and other macros // ---------------------------------------------------------------------------- -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxTextCtrlStyle ) - -wxBEGIN_FLAGS( wxTextCtrlStyle ) - // 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(wxTE_PROCESS_ENTER) - wxFLAGS_MEMBER(wxTE_PROCESS_TAB) - wxFLAGS_MEMBER(wxTE_MULTILINE) - wxFLAGS_MEMBER(wxTE_PASSWORD) - wxFLAGS_MEMBER(wxTE_READONLY) - wxFLAGS_MEMBER(wxHSCROLL) - wxFLAGS_MEMBER(wxTE_RICH) - wxFLAGS_MEMBER(wxTE_RICH2) - wxFLAGS_MEMBER(wxTE_AUTO_URL) - wxFLAGS_MEMBER(wxTE_NOHIDESEL) - wxFLAGS_MEMBER(wxTE_LEFT) - wxFLAGS_MEMBER(wxTE_CENTRE) - wxFLAGS_MEMBER(wxTE_RIGHT) - wxFLAGS_MEMBER(wxTE_DONTWRAP) - wxFLAGS_MEMBER(wxTE_LINEWRAP) - wxFLAGS_MEMBER(wxTE_WORDWRAP) - -wxEND_FLAGS( wxTextCtrlStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxTextCtrl, wxControl,"wx/textctrl.h") - -wxBEGIN_PROPERTIES_TABLE(wxTextCtrl) - wxEVENT_PROPERTY( TextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) - wxEVENT_PROPERTY( TextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) - - wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) - wxPROPERTY( Value , wxString , SetValue, GetValue, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - wxPROPERTY_FLAGS( WindowStyle , wxTextCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxTextCtrl) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_6( wxTextCtrl , wxWindow* , Parent , wxWindowID , Id , wxString , Value , wxPoint , Position , wxSize , Size , long , WindowStyle) -#else -IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl) -#endif - - -BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) +BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase) EVT_CHAR(wxTextCtrl::OnChar) EVT_DROP_FILES(wxTextCtrl::OnDropFiles) @@ -213,11 +140,6 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, return false; } -WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const -{ - return 0; -} - // ---------------------------------------------------------------------------- // set/get the controls text // ---------------------------------------------------------------------------- @@ -225,71 +147,24 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const wxString wxTextCtrl::GetValue() const { wxString res; - return res; } -void wxTextCtrl::SetValue(const wxString& value) +wxString wxTextCtrl::GetRange(long from, long to) const { + wxString res; + return res; } -#if wxUSE_RICHEDIT && (!wxUSE_UNICODE || wxUSE_UNICODE_MSLU) - -// TODO: using memcpy() would improve performance a lot for big amounts of text - -DWORD CALLBACK -wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb) -{ - return 0; -} - -// helper struct used to pass parameters from wxTextCtrl to wxRichEditStreamOut -struct wxStreamOutData -{ - wchar_t *wpc; - size_t len; -}; - -DWORD CALLBACK -wxRichEditStreamOut(DWORD_PTR dwCookie, BYTE *buf, LONG cb, LONG *pcb) -{ - return 0; -} - - -#if wxUSE_UNICODE_MSLU - #define UNUSED_IF_MSLU(param) -#else - #define UNUSED_IF_MSLU(param) param -#endif - -bool -wxTextCtrl::StreamIn(const wxString& value, - wxFontEncoding UNUSED_IF_MSLU(encoding), - bool selectionOnly) -{ - return false; -} - -#if !wxUSE_UNICODE_MSLU - -wxString -wxTextCtrl::StreamOut(wxFontEncoding encoding, bool selectionOnly) const +void wxTextCtrl::DoSetValue(const wxString& value, int flags) { - wxString out; - - return out; } -#endif // !wxUSE_UNICODE_MSLU - -#endif // wxUSE_RICHEDIT - void wxTextCtrl::WriteText(const wxString& value) { } -void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly) +void wxTextCtrl::DoWriteText(const wxString& text, int flags) { } @@ -317,11 +192,6 @@ void wxTextCtrl::Paste() { } -bool wxTextCtrl::HasSelection() const -{ - return false; -} - bool wxTextCtrl::CanCopy() const { return false; @@ -382,7 +252,7 @@ void wxTextCtrl::SetSelection(long from, long to) { } -void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret) +void wxTextCtrl::DoSetSelection(long from, long to, int flags) { } @@ -390,7 +260,7 @@ void wxTextCtrl::DoSetSelection(long from, long to, bool scrollCaret) // Working with files // ---------------------------------------------------------------------------- -bool wxTextCtrl::LoadFile(const wxString& file) +bool wxTextCtrl::DoLoadFile(const wxString& file, int fileType) { return false; } @@ -440,7 +310,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const } wxTextCtrlHitTestResult -wxTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const +wxTextCtrl::HitTest(const wxPoint& pt, long *pos) const { return wxTE_HT_UNKNOWN; } @@ -488,10 +358,12 @@ void wxTextCtrl::Redo() bool wxTextCtrl::CanUndo() const { + return false; } bool wxTextCtrl::CanRedo() const { + return false; } // ---------------------------------------------------------------------------- @@ -519,20 +391,10 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) // kbd input processing // ---------------------------------------------------------------------------- -bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* pMsg) -{ - return false; -} - void wxTextCtrl::OnChar(wxKeyEvent& event) { } -WXLRESULT wxTextCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) -{ - return 0; -} - // ---------------------------------------------------------------------------- // text control event processing // ---------------------------------------------------------------------------- @@ -542,21 +404,11 @@ bool wxTextCtrl::SendUpdateEvent() return false; } -bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) -{ - return false; -} - bool wxTextCtrl::AdjustSpaceLimit() { return false; } -bool wxTextCtrl::AcceptsFocus() const -{ - return false; -} - wxSize wxTextCtrl::DoGetBestSize() const { return wxSize(0,0); @@ -622,11 +474,39 @@ void wxTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event) { } -void wxTextCtrl::OnRightClick(wxMouseEvent& event) +void wxTextCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event)) { } -void wxTextCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event)) +wxVisualAttributes wxTextCtrl::GetDefaultAttributes() const +{ + wxVisualAttributes attrs; + attrs.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); + attrs.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); + attrs.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); //white + return attrs; +} + +bool wxTextCtrl::EmulateKeyPress(const wxKeyEvent& rEvent) +{ + return false; +} +bool wxTextCtrl::CanApplyThemeBorder() const +{ + return false; +} +bool wxTextCtrl::IsEmpty() const +{ + return false; +} +bool wxTextCtrl::AcceptsFocusFromKeyboard() const +{ + return false; +} +void wxTextCtrl::AdoptAttributesFromHWND() +{ +} +void wxTextCtrl::SetWindowStyleFlag(long lStyle) { } @@ -657,43 +537,43 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour) } // ---------------------------------------------------------------------------- -// styling support for rich edit controls +// wxRichEditModule // ---------------------------------------------------------------------------- -#if wxUSE_RICHEDIT - -bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) +bool wxRichEditModule::OnInit() { return false; } -bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) +void wxRichEditModule::OnExit() { - return false; } -bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) +/* static */ +bool wxRichEditModule::Load(int version) { return false; } -#endif +#endif // wxUSE_RICHEDIT // ---------------------------------------------------------------------------- -// wxRichEditModule +// styling support for rich edit controls // ---------------------------------------------------------------------------- -bool wxRichEditModule::OnInit() +#if wxUSE_RICHEDIT + +bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) { return false; } -void wxRichEditModule::OnExit() +bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) { + return false; } -/* static */ -bool wxRichEditModule::Load(int version) +bool wxTextCtrl::GetStyle(long position, wxTextAttr& style) { return false; }