removed WXWIN_COMPATIBILITY and WXWIN_COMPATIBILITY_2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,16 +68,6 @@ wxSize wxControl::DoGetBestSize() const
|
||||
|
||||
bool wxControl::ProcessCommand(wxCommandEvent& event)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(*this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -304,16 +304,6 @@ int wxNewEventType()
|
||||
// MT-FIXME
|
||||
static int s_lastUsedEventType = wxEVT_FIRST;
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// check that we don't overlap with the user-defined types: if it does
|
||||
// happen, the best solution is probably to update the existing code to
|
||||
// use wxNewEventType() instead of wxEVT_USER_FIRST
|
||||
//
|
||||
// due to the uncertainty
|
||||
wxASSERT_MSG( s_lastUsedEventType < wxEVT_USER_FIRST - 1,
|
||||
_T("possible event type conflict") );
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return s_lastUsedEventType++;
|
||||
}
|
||||
|
||||
@@ -1321,17 +1311,6 @@ void *wxEvtHandler::DoGetClientData() const
|
||||
return m_clientData;
|
||||
}
|
||||
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
bool wxEvtHandler::OnClose()
|
||||
{
|
||||
if (GetNextHandler())
|
||||
return GetNextHandler()->OnClose();
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
#endif // wxUSE_BASE
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
@@ -887,47 +887,5 @@ int wxFTP::GetFileSize(const wxString& fileName)
|
||||
return filesize;
|
||||
}
|
||||
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// deprecated
|
||||
wxList *wxFTP::GetList(const wxString& wildcard, bool details)
|
||||
{
|
||||
wxSocketBase *sock = GetPort();
|
||||
if (!sock)
|
||||
return NULL;
|
||||
wxList *file_list = new wxList;
|
||||
wxString line;
|
||||
// NLST : List of Filenames (including Directory's !)
|
||||
// LIST : depending on BS of FTP-Server
|
||||
// - Unix : result like "ls" command
|
||||
// - Windows : like "dir" command
|
||||
// - others : ?
|
||||
if (!details)
|
||||
line = _T("NLST"); // Default
|
||||
else
|
||||
line = _T("LIST");
|
||||
if (!wildcard.IsNull())
|
||||
line += wildcard;
|
||||
if (!CheckCommand(line, '1'))
|
||||
{
|
||||
delete sock;
|
||||
delete file_list;
|
||||
return NULL;
|
||||
}
|
||||
while (GetLine(sock, line) == wxPROTO_NOERR)
|
||||
{
|
||||
file_list->Append((wxObject *)(new wxString(line)));
|
||||
}
|
||||
if (!CheckResult('2'))
|
||||
{
|
||||
delete sock;
|
||||
file_list->DeleteContents(TRUE);
|
||||
delete file_list;
|
||||
return NULL;
|
||||
}
|
||||
return file_list;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#endif // wxUSE_PROTOCOL_FTP
|
||||
|
||||
|
@@ -1013,134 +1013,4 @@ bool wxLayoutConstraints::SatisfyConstraints(wxWindowBase *win, int *nChanges)
|
||||
return AreSatisfied();
|
||||
}
|
||||
|
||||
/*
|
||||
* Main constrained layout algorithm. Look at all the child
|
||||
* windows, and their constraints (if any).
|
||||
* The idea is to keep iterating through the constraints
|
||||
* until all left, right, bottom and top edges, and widths and heights,
|
||||
* are known (or no change occurs and we've failed to resolve all
|
||||
* constraints).
|
||||
*
|
||||
* If the user has not specified a dimension or edge, it will be
|
||||
* be calculated from the other known values. E.g. If we know
|
||||
* the right hand edge and the left hand edge, we now know the width.
|
||||
* The snag here is that this means we must specify absolute dimensions
|
||||
* twice (in constructor and in constraint), if we wish to use the
|
||||
* constraint notation to just set the position, for example.
|
||||
* Otherwise, if we only set ONE edge and no dimension, it would never
|
||||
* find the other edge.
|
||||
*
|
||||
* Algorithm:
|
||||
|
||||
Mark all constraints as not done.
|
||||
|
||||
iterations = 0;
|
||||
until no change or iterations >= max iterations
|
||||
For each child:
|
||||
{
|
||||
Calculate all constraints
|
||||
}
|
||||
iterations ++;
|
||||
|
||||
For each child
|
||||
Set each calculated position and size
|
||||
|
||||
*/
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
bool wxOldDoLayout(wxWindowBase *win)
|
||||
{
|
||||
// Make sure this isn't called recursively from below
|
||||
static wxList doneSoFar;
|
||||
|
||||
if (doneSoFar.Member(win))
|
||||
return TRUE;
|
||||
|
||||
doneSoFar.Append(win);
|
||||
|
||||
wxNode *node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindowBase *child = (wxWindowBase *)node->Data();
|
||||
wxLayoutConstraints *constr = child->GetConstraints();
|
||||
if (constr)
|
||||
{
|
||||
constr->left.SetDone(FALSE);
|
||||
constr->top.SetDone(FALSE);
|
||||
constr->right.SetDone(FALSE);
|
||||
constr->bottom.SetDone(FALSE);
|
||||
constr->width.SetDone(FALSE);
|
||||
constr->height.SetDone(FALSE);
|
||||
constr->centreX.SetDone(FALSE);
|
||||
constr->centreY.SetDone(FALSE);
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
int noIterations = 0;
|
||||
int maxIterations = 500;
|
||||
int noChanges = 1;
|
||||
|
||||
while ((noChanges > 0) && (noIterations < maxIterations))
|
||||
{
|
||||
noChanges = 0;
|
||||
wxNode *node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindowBase *child = (wxWindowBase *)node->Data();
|
||||
wxLayoutConstraints *constr = child->GetConstraints();
|
||||
if (constr)
|
||||
{
|
||||
int tempNoChanges = 0;
|
||||
(void)constr->SatisfyConstraints(child, &tempNoChanges);
|
||||
noChanges += tempNoChanges;
|
||||
}
|
||||
node = node->Next();
|
||||
}
|
||||
noIterations ++;
|
||||
}
|
||||
/*
|
||||
// Would be nice to have a test here to see _which_ constraint(s)
|
||||
// failed, so we can print a specific diagnostic message.
|
||||
if (noFailures > 0)
|
||||
{
|
||||
wxDebugMsg(_("wxWindowBase::Layout() failed.\n"));
|
||||
}
|
||||
*/
|
||||
// Now set the sizes and positions of the children, and
|
||||
// recursively call Layout().
|
||||
node = win->GetChildren().First();
|
||||
while (node)
|
||||
{
|
||||
wxWindowBase *child = (wxWindowBase *)node->Data();
|
||||
wxLayoutConstraints *constr = child->GetConstraints();
|
||||
if (constr && constr->left.GetDone() && constr->right.GetDone() &&
|
||||
constr->width.GetDone() && constr->height.GetDone())
|
||||
{
|
||||
int x = constr->left.GetValue();
|
||||
int y = constr->top.GetValue();
|
||||
int w = constr->width.GetValue();
|
||||
int h = constr->height.GetValue();
|
||||
|
||||
// If we don't want to resize this window, just move it...
|
||||
if ((constr->width.GetRelationship() != wxAsIs) ||
|
||||
(constr->height.GetRelationship() != wxAsIs))
|
||||
{
|
||||
// _Should_ call Layout() recursively.
|
||||
child->SetSize(x, y, w, h);
|
||||
}
|
||||
else
|
||||
{
|
||||
child->Move(x, y);
|
||||
}
|
||||
}
|
||||
else
|
||||
child->Layout();
|
||||
node = node->Next();
|
||||
}
|
||||
doneSoFar.DeleteObject(win);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
#endif // wxUSE_CONSTRAINTS
|
||||
|
@@ -94,10 +94,6 @@ public:
|
||||
wxSocketEventFlags m_eventmask;
|
||||
bool m_notify;
|
||||
void *m_clientData;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxSocketBase::wxSockCbk m_cbk;
|
||||
char *m_cdata;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
public:
|
||||
wxSocketState() : wxObject() {}
|
||||
@@ -184,10 +180,6 @@ void wxSocketBase::Init()
|
||||
m_clientData = NULL;
|
||||
m_notify = FALSE;
|
||||
m_eventmask = 0;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_cbk = NULL;
|
||||
m_cdata = NULL;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
if ( !IsInitialized() )
|
||||
{
|
||||
@@ -824,10 +816,6 @@ void wxSocketBase::SaveState()
|
||||
state->m_notify = m_notify;
|
||||
state->m_eventmask = m_eventmask;
|
||||
state->m_clientData = m_clientData;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
state->m_cbk = m_cbk;
|
||||
state->m_cdata = m_cdata;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
m_states.Append(state);
|
||||
}
|
||||
@@ -847,11 +835,7 @@ void wxSocketBase::RestoreState()
|
||||
m_notify = state->m_notify;
|
||||
m_eventmask = state->m_eventmask;
|
||||
m_clientData = state->m_clientData;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_cbk = state->m_cbk;
|
||||
m_cdata = state->m_cdata;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
|
||||
m_states.Erase(node);
|
||||
delete state;
|
||||
}
|
||||
@@ -874,30 +858,6 @@ void wxSocketBase::SetFlags(wxSocketFlags flags)
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Callbacks (now obsolete - use events instead)
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
|
||||
wxSocketBase::wxSockCbk wxSocketBase::Callback(wxSockCbk cbk_)
|
||||
{
|
||||
wxSockCbk old_cbk = cbk_;
|
||||
|
||||
m_cbk = cbk_;
|
||||
return old_cbk;
|
||||
}
|
||||
|
||||
char *wxSocketBase::CallbackData(char *data)
|
||||
{
|
||||
char *old_data = m_cdata;
|
||||
|
||||
m_cdata = data;
|
||||
return old_data;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Event handling
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -992,11 +952,6 @@ void wxSocketBase::OnRequest(wxSocketNotify notification)
|
||||
|
||||
m_handler->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if (m_cbk)
|
||||
m_cbk(*this, notification, m_cdata);
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -331,9 +331,6 @@ bool wxWindowBase::Close(bool force)
|
||||
{
|
||||
wxCloseEvent event(wxEVT_CLOSE_WINDOW, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
#if WXWIN_COMPATIBILITY
|
||||
event.SetForce(force);
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
event.SetCanVeto(!force);
|
||||
|
||||
// return FALSE if window wasn't closed because the application vetoed the
|
||||
|
@@ -119,28 +119,6 @@ wxString wxGetSingleChoice( const wxString& message,
|
||||
return res;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// Overloaded for backward compatibility
|
||||
wxString wxGetSingleChoice( const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, wxChar *choices[],
|
||||
wxWindow *parent,
|
||||
int x, int y, bool centre,
|
||||
int width, int height )
|
||||
{
|
||||
wxString *strings = new wxString[n];
|
||||
int i;
|
||||
for ( i = 0; i < n; i++)
|
||||
{
|
||||
strings[i] = choices[i];
|
||||
}
|
||||
wxString ans(wxGetSingleChoice(message, caption, n, (const wxString *)strings, parent,
|
||||
x, y, centre, width, height));
|
||||
delete[] strings;
|
||||
return ans;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
int wxGetSingleChoiceIndex( const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
@@ -176,25 +154,6 @@ int wxGetSingleChoiceIndex( const wxString& message,
|
||||
return res;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// Overloaded for backward compatibility
|
||||
int wxGetSingleChoiceIndex( const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, wxChar *choices[],
|
||||
wxWindow *parent,
|
||||
int x, int y, bool centre,
|
||||
int width, int height )
|
||||
{
|
||||
wxString *strings = new wxString[n];
|
||||
for ( int i = 0; i < n; i++)
|
||||
strings[i] = choices[i];
|
||||
int ans = wxGetSingleChoiceIndex(message, caption, n, (const wxString *)strings, parent,
|
||||
x, y, centre, width, height);
|
||||
delete[] strings;
|
||||
return ans;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
void *wxGetSingleChoiceData( const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
@@ -234,30 +193,6 @@ void *wxGetSingleChoiceData( const wxString& message,
|
||||
return res;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// Overloaded for backward compatibility
|
||||
void *wxGetSingleChoiceData( const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, wxChar *choices[],
|
||||
void **client_data,
|
||||
wxWindow *parent,
|
||||
int x, int y, bool centre, int width, int height )
|
||||
{
|
||||
wxString *strings = new wxString[n];
|
||||
int i;
|
||||
for ( i = 0; i < n; i++)
|
||||
{
|
||||
strings[i] = choices[i];
|
||||
}
|
||||
void *data = wxGetSingleChoiceData(message, caption,
|
||||
n, (const wxString *)strings,
|
||||
client_data, parent,
|
||||
x, y, centre, width, height);
|
||||
delete[] strings;
|
||||
return data;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
size_t wxGetMultipleChoices(wxArrayInt& selections,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
@@ -373,40 +308,6 @@ wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
|
||||
Create(parent, message, caption, n, choices, clientData, style);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
|
||||
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxStringList& choices,
|
||||
char **clientData,
|
||||
long style,
|
||||
const wxPoint& WXUNUSED(pos))
|
||||
{
|
||||
Create(parent, message, caption, choices, clientData, style);
|
||||
}
|
||||
|
||||
bool wxSingleChoiceDialog::Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxStringList& choices,
|
||||
char **clientData,
|
||||
long style,
|
||||
const wxPoint& pos)
|
||||
{
|
||||
wxString *strings = new wxString[choices.Number()];
|
||||
int i;
|
||||
for ( i = 0; i < choices.Number(); i++)
|
||||
{
|
||||
strings[i] = (char *)choices.Nth(i)->Data();
|
||||
}
|
||||
bool ans = Create(parent, message, caption, choices.Number(), strings, clientData, style, pos);
|
||||
delete[] strings;
|
||||
return ans;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
bool wxSingleChoiceDialog::Create( wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
|
@@ -1303,24 +1303,6 @@ wxGenericScrolledWindow::MSWWindowProc(WXUINT nMsg,
|
||||
|
||||
#endif // __WXMSW__
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
|
||||
void wxGenericScrolledWindow::GetScrollUnitsPerPage (int *x_page, int *y_page) const
|
||||
{
|
||||
*x_page = GetScrollPageSize(wxHORIZONTAL);
|
||||
*y_page = GetScrollPageSize(wxVERTICAL);
|
||||
}
|
||||
|
||||
void wxGenericScrolledWindow::CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const
|
||||
{
|
||||
if ( xx )
|
||||
*xx = (float)(x + m_xScrollPosition * m_xScrollPixelsPerLine);
|
||||
if ( yy )
|
||||
*yy = (float)(y + m_yScrollPosition * m_yScrollPixelsPerLine);
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
#endif // !wxGTK
|
||||
|
||||
// vi:sts=4:sw=4:et
|
||||
|
@@ -147,9 +147,6 @@ wxControl::wxControl()
|
||||
m_macVerticalBorder = 0 ;
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_callback = 0;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
if ( wxMacLiveScrollbarActionUPP == NULL )
|
||||
{
|
||||
@@ -265,22 +262,10 @@ wxSize wxControl::DoGetBestSize() const
|
||||
|
||||
bool wxControl::ProcessCommand (wxCommandEvent & event)
|
||||
{
|
||||
// Tries:
|
||||
// 1) A callback function (to become obsolete)
|
||||
// 2) OnCommand, starting at this window and working up parent hierarchy
|
||||
// 3) OnCommand then calls ProcessEvent to search the event tables.
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
{
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
// Tries:
|
||||
// 1) OnCommand, starting at this window and working up parent hierarchy
|
||||
// 2) OnCommand then calls ProcessEvent to search the event tables.
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
|
@@ -276,15 +276,6 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
|
||||
{
|
||||
bool processed = FALSE;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Try a callback
|
||||
if (m_callback)
|
||||
{
|
||||
(void)(*(m_callback))(*this, event);
|
||||
processed = TRUE;
|
||||
}
|
||||
#endif WXWIN_COMPATIBILITY
|
||||
|
||||
// Try the menu's event handler
|
||||
if ( !processed && GetEventHandler())
|
||||
{
|
||||
|
@@ -922,48 +922,6 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// ---------------------------------------------------------------------------
|
||||
// Caret manipulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxWindowMac::CreateCaret(int w, int h)
|
||||
{
|
||||
SetCaret(new wxCaret(this, w, h));
|
||||
}
|
||||
|
||||
void wxWindowMac::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
}
|
||||
|
||||
void wxWindowMac::ShowCaret(bool show)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to show" );
|
||||
|
||||
m_caret->Show(show);
|
||||
}
|
||||
|
||||
void wxWindowMac::DestroyCaret()
|
||||
{
|
||||
SetCaret(NULL);
|
||||
}
|
||||
|
||||
void wxWindowMac::SetCaretPos(int x, int y)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to move" );
|
||||
|
||||
m_caret->Move(x, y);
|
||||
}
|
||||
|
||||
void wxWindowMac::GetCaretPos(int *x, int *y) const
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to get position of" );
|
||||
|
||||
m_caret->GetPosition(x, y);
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
wxWindowMac *wxGetActiveWindow()
|
||||
{
|
||||
// actually this is a windows-only concept
|
||||
@@ -1304,37 +1262,6 @@ wxWindowMac *wxWindowBase::FindFocus()
|
||||
return gFocusWindow ;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// If nothing defined for this, try the parent.
|
||||
// E.g. we may be a button loaded from a resource, with no callback function
|
||||
// defined.
|
||||
void wxWindowMac::OnCommand(wxWindowMac& win, wxCommandEvent& event)
|
||||
{
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return;
|
||||
if ( m_parent )
|
||||
m_parent->GetEventHandler()->OnCommand(win, event);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxObject* wxWindowMac::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
wxNode *node = GetChildren().GetFirst();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->GetNext();
|
||||
if ( node )
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->GetData();
|
||||
return(obj);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
void wxWindowMac::OnSetFocus(wxFocusEvent& event)
|
||||
{
|
||||
// panel wants to track the window which was the last to have focus in it,
|
||||
|
@@ -147,9 +147,6 @@ wxControl::wxControl()
|
||||
m_macVerticalBorder = 0 ;
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_callback = 0;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
if ( wxMacLiveScrollbarActionUPP == NULL )
|
||||
{
|
||||
@@ -265,22 +262,10 @@ wxSize wxControl::DoGetBestSize() const
|
||||
|
||||
bool wxControl::ProcessCommand (wxCommandEvent & event)
|
||||
{
|
||||
// Tries:
|
||||
// 1) A callback function (to become obsolete)
|
||||
// 2) OnCommand, starting at this window and working up parent hierarchy
|
||||
// 3) OnCommand then calls ProcessEvent to search the event tables.
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
{
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
// Tries:
|
||||
// 1) OnCommand, starting at this window and working up parent hierarchy
|
||||
// 2) OnCommand then calls ProcessEvent to search the event tables.
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
|
@@ -276,15 +276,6 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
|
||||
{
|
||||
bool processed = FALSE;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Try a callback
|
||||
if (m_callback)
|
||||
{
|
||||
(void)(*(m_callback))(*this, event);
|
||||
processed = TRUE;
|
||||
}
|
||||
#endif WXWIN_COMPATIBILITY
|
||||
|
||||
// Try the menu's event handler
|
||||
if ( !processed && GetEventHandler())
|
||||
{
|
||||
|
@@ -922,48 +922,6 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// ---------------------------------------------------------------------------
|
||||
// Caret manipulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxWindowMac::CreateCaret(int w, int h)
|
||||
{
|
||||
SetCaret(new wxCaret(this, w, h));
|
||||
}
|
||||
|
||||
void wxWindowMac::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
}
|
||||
|
||||
void wxWindowMac::ShowCaret(bool show)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to show" );
|
||||
|
||||
m_caret->Show(show);
|
||||
}
|
||||
|
||||
void wxWindowMac::DestroyCaret()
|
||||
{
|
||||
SetCaret(NULL);
|
||||
}
|
||||
|
||||
void wxWindowMac::SetCaretPos(int x, int y)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to move" );
|
||||
|
||||
m_caret->Move(x, y);
|
||||
}
|
||||
|
||||
void wxWindowMac::GetCaretPos(int *x, int *y) const
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to get position of" );
|
||||
|
||||
m_caret->GetPosition(x, y);
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
wxWindowMac *wxGetActiveWindow()
|
||||
{
|
||||
// actually this is a windows-only concept
|
||||
@@ -1304,37 +1262,6 @@ wxWindowMac *wxWindowBase::FindFocus()
|
||||
return gFocusWindow ;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// If nothing defined for this, try the parent.
|
||||
// E.g. we may be a button loaded from a resource, with no callback function
|
||||
// defined.
|
||||
void wxWindowMac::OnCommand(wxWindowMac& win, wxCommandEvent& event)
|
||||
{
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return;
|
||||
if ( m_parent )
|
||||
m_parent->GetEventHandler()->OnCommand(win, event);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxObject* wxWindowMac::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
wxNode *node = GetChildren().GetFirst();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->GetNext();
|
||||
if ( node )
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->GetData();
|
||||
return(obj);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
void wxWindowMac::OnSetFocus(wxFocusEvent& event)
|
||||
{
|
||||
// panel wants to track the window which was the last to have focus in it,
|
||||
|
@@ -88,14 +88,3 @@ void wxColour::Set(unsigned char r, unsigned char g, unsigned char b)
|
||||
m_blue = b;
|
||||
m_isInit = TRUE;
|
||||
}
|
||||
|
||||
// Obsolete
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxColour::Get(unsigned char *r, unsigned char *g, unsigned char *b) const
|
||||
{
|
||||
*r = m_red;
|
||||
*g = m_green;
|
||||
*b = m_blue;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -855,37 +855,6 @@ void wxWindowMGL::WarpPointer(int x, int y)
|
||||
EVT_setMousePos(x, y);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// If nothing defined for this, try the parent.
|
||||
// E.g. we may be a button loaded from a resource, with no callback function
|
||||
// defined.
|
||||
void wxWindowMGL::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
{
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return;
|
||||
if ( m_parent )
|
||||
m_parent->GetEventHandler()->OnCommand(win, event);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxObject* wxWindowMGL::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
wxNode *node = GetChildren().First();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->Next();
|
||||
if ( node )
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->Data();
|
||||
return(obj);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// Set this window to be the child of 'parent'.
|
||||
bool wxWindowMGL::Reparent(wxWindowBase *parent)
|
||||
{
|
||||
@@ -1103,48 +1072,6 @@ void wxWindowMGL::GetTextExtent(const wxString& string,
|
||||
dc.GetTextExtent(string, x, y, descent, externalLeading, (wxFont*)theFont);
|
||||
}
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// ---------------------------------------------------------------------------
|
||||
// Caret manipulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxWindowMGL::CreateCaret(int w, int h)
|
||||
{
|
||||
SetCaret(new wxCaret(this, w, h));
|
||||
}
|
||||
|
||||
void wxWindowMGL::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
}
|
||||
|
||||
void wxWindowMGL::ShowCaret(bool show)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to show" );
|
||||
|
||||
m_caret->Show(show);
|
||||
}
|
||||
|
||||
void wxWindowMGL::DestroyCaret()
|
||||
{
|
||||
SetCaret(NULL);
|
||||
}
|
||||
|
||||
void wxWindowMGL::SetCaretPos(int x, int y)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to move" );
|
||||
|
||||
m_caret->Move(x, y);
|
||||
}
|
||||
|
||||
void wxWindowMGL::GetCaretPos(int *x, int *y) const
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to get position of" );
|
||||
|
||||
m_caret->GetPosition(x, y);
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// painting
|
||||
|
@@ -40,10 +40,6 @@ wxControl::wxControl()
|
||||
m_backgroundColour = *wxWHITE;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_callback = 0;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
m_inSetValue = FALSE;
|
||||
}
|
||||
|
||||
@@ -113,15 +109,5 @@ wxString wxControl::GetLabel() const
|
||||
|
||||
bool wxControl::ProcessCommand(wxCommandEvent & event)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
@@ -260,10 +260,6 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon)
|
||||
// delete the old one now as we don't need it any more
|
||||
::DeleteObject(iconInfo.hbmMask);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
refData->m_ok = TRUE;
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
@@ -322,10 +318,6 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
|
||||
|
||||
refData->m_hBitmap = (WXHBITMAP)hbitmap;
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
refData->m_ok = TRUE;
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return TRUE;
|
||||
#else // Win32
|
||||
return CopyFromIconOrCursor(icon);
|
||||
@@ -558,10 +550,6 @@ bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
|
||||
|
||||
SetHBITMAP((WXHBITMAP)hbmp);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
GetBitmapData()->m_ok = hbmp != 0;
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return Ok();
|
||||
}
|
||||
|
||||
@@ -686,11 +674,6 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, const wxDC& dc)
|
||||
SetPalette(image.GetPalette());
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// check the wxBitmap object
|
||||
GetBitmapData()->SetOk();
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -825,10 +808,6 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc )
|
||||
// validate this object
|
||||
SetHBITMAP((WXHBITMAP)hbitmap);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
m_refData->m_ok = TRUE;
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
// finally also set the mask if we have one
|
||||
if ( image.HasMask() )
|
||||
{
|
||||
@@ -1397,17 +1376,6 @@ void wxBitmap::SetMask(wxMask *mask)
|
||||
GetBitmapData()->SetMask(mask);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
|
||||
void wxBitmap::SetOk(bool isOk)
|
||||
{
|
||||
EnsureHasData();
|
||||
|
||||
GetBitmapData()->m_ok = isOk;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
|
||||
void wxBitmap::SetQuality(int WXUNUSED(quality))
|
||||
|
@@ -430,9 +430,6 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
|
||||
wxBM->SetWidth(bm.bmWidth);
|
||||
wxBM->SetHeight(bm.bmHeight);
|
||||
wxBM->SetDepth(bm.bmPlanes);
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
wxBM->SetOk(TRUE);
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
retval = wxBM;
|
||||
break;
|
||||
}
|
||||
|
@@ -111,14 +111,3 @@ void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
|
||||
m_isInit = TRUE;
|
||||
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||
}
|
||||
|
||||
// Obsolete
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxColour::Get (unsigned char *r, unsigned char *g, unsigned char *b) const
|
||||
{
|
||||
*r = m_red;
|
||||
*g = m_green;
|
||||
*b = m_blue;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -46,9 +46,6 @@ END_EVENT_TABLE()
|
||||
// Item members
|
||||
wxControl::wxControl()
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_callback = 0;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
}
|
||||
|
||||
wxControl::~wxControl()
|
||||
@@ -173,16 +170,6 @@ wxSize wxControl::DoGetBestSize() const
|
||||
|
||||
bool wxControl::ProcessCommand(wxCommandEvent& event)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(*this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -270,10 +270,6 @@ wxCursor::wxCursor(const wxString& filename,
|
||||
if ( hcursor )
|
||||
{
|
||||
m_refData = new wxCursorRefData(hcursor, true /* delete it later */);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
((wxCursorRefData *)m_refData)->SetOk();
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,12 +39,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
||||
pagesize( long , 1)
|
||||
*/
|
||||
|
||||
BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
|
||||
#if WXWIN_COMPATIBILITY
|
||||
EVT_SCROLL(wxScrollBar::OnScroll)
|
||||
#endif
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
// Scrollbar
|
||||
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||
@@ -324,76 +318,6 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS
|
||||
}
|
||||
|
||||
|
||||
/* From the WIN32 documentation:
|
||||
In version 4.0 or later, the maximum value that a scroll bar can report
|
||||
(that is, the maximum scrolling position) depends on the page size.
|
||||
If the scroll bar has a page size greater than one, the maximum scrolling position
|
||||
is less than the maximum range value. You can use the following formula to calculate
|
||||
the maximum scrolling position:
|
||||
|
||||
MaxScrollPos = MaxRangeValue - (PageSize - 1)
|
||||
*/
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxScrollBar::SetPageSize(int pageLength)
|
||||
{
|
||||
m_pageSize = pageLength;
|
||||
|
||||
#if defined(__WIN95__)
|
||||
SCROLLINFO info;
|
||||
info.cbSize = sizeof(SCROLLINFO);
|
||||
info.nPage = pageLength;
|
||||
info.fMask = SIF_PAGE ;
|
||||
|
||||
::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxScrollBar::SetObjectLength(int objectLength)
|
||||
{
|
||||
m_objectSize = objectLength;
|
||||
|
||||
// The range (number of scroll steps) is the
|
||||
// object length minus the view size.
|
||||
int range = wxMax((objectLength - m_viewSize), 0) ;
|
||||
|
||||
#if defined(__WIN95__)
|
||||
// Try to adjust the range to cope with page size > 1
|
||||
// (see comment for SetPageLength)
|
||||
if ( m_pageSize > 1 )
|
||||
{
|
||||
range += (m_pageSize - 1);
|
||||
}
|
||||
|
||||
SCROLLINFO info;
|
||||
info.cbSize = sizeof(SCROLLINFO);
|
||||
info.nPage = 0;
|
||||
info.nMin = 0;
|
||||
info.nMax = range;
|
||||
info.nPos = 0;
|
||||
info.fMask = SIF_RANGE ;
|
||||
|
||||
::SetScrollInfo((HWND) GetHWND(), SB_CTL, &info, TRUE);
|
||||
#else
|
||||
::SetScrollRange((HWND)m_hWnd, SB_CTL, 0, range, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void wxScrollBar::SetViewLength(int viewLength)
|
||||
{
|
||||
m_viewSize = viewLength;
|
||||
}
|
||||
|
||||
void wxScrollBar::GetValues(int *viewStart, int *viewLength, int *objectLength,
|
||||
int *pageLength) const
|
||||
{
|
||||
*viewStart = ::GetScrollPos((HWND)m_hWnd, SB_CTL);
|
||||
*viewLength = m_viewSize;
|
||||
*objectLength = m_objectSize;
|
||||
*pageLength = m_pageSize;
|
||||
}
|
||||
#endif
|
||||
|
||||
WXHBRUSH wxScrollBar::OnCtlColor(WXHDC WXUNUSED(pDC), WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
|
||||
WXUINT WXUNUSED(message), WXWPARAM WXUNUSED(wParam), WXLPARAM WXUNUSED(lParam))
|
||||
{
|
||||
@@ -406,19 +330,4 @@ void wxScrollBar::Command(wxCommandEvent& event)
|
||||
ProcessCommand(event);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Backward compatibility
|
||||
void wxScrollBar::OnScroll(wxScrollEvent& event)
|
||||
{
|
||||
wxEventType oldEvent = event.GetEventType();
|
||||
event.SetEventType( wxEVT_COMMAND_SCROLLBAR_UPDATED );
|
||||
if ( !GetEventHandler()->ProcessEvent(event) )
|
||||
{
|
||||
event.SetEventType( oldEvent );
|
||||
if (!GetParent()->GetEventHandler()->ProcessEvent(event))
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_SCROLLBAR
|
||||
|
@@ -728,12 +728,6 @@ void wxWindowMSW::WarpPointer (int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxWindowMSW::MSWDeviceToLogical (float *x, float *y) const
|
||||
{
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// scrolling stuff
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -744,48 +738,6 @@ static inline int wxDirToWinStyle(int orient)
|
||||
return orient == wxHORIZONTAL ? SB_HORZ : SB_VERT;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxWindowMSW::SetScrollRange(int orient, int range, bool refresh)
|
||||
{
|
||||
int range1 = range;
|
||||
|
||||
// Try to adjust the range to cope with page size > 1
|
||||
// - a Windows API quirk
|
||||
int pageSize = GetScrollPage(orient);
|
||||
if ( pageSize > 1 && range > 0)
|
||||
{
|
||||
range1 += (pageSize - 1);
|
||||
}
|
||||
|
||||
WinStruct<SCROLLINFO> info;
|
||||
info.nPage = pageSize; // Have to set this, or scrollbar goes awry
|
||||
info.nMin = 0;
|
||||
info.nMax = range1;
|
||||
info.fMask = SIF_RANGE | SIF_PAGE;
|
||||
|
||||
HWND hWnd = GetHwnd();
|
||||
if ( hWnd )
|
||||
::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
|
||||
}
|
||||
|
||||
void wxWindowMSW::SetScrollPage(int orient, int page, bool refresh)
|
||||
{
|
||||
WinStruct<SCROLLINFO> info;
|
||||
info.nPage = page;
|
||||
info.fMask = SIF_PAGE;
|
||||
|
||||
HWND hWnd = GetHwnd();
|
||||
if ( hWnd )
|
||||
::SetScrollInfo(hWnd, wxDirToWinStyle(orient), &info, refresh);
|
||||
}
|
||||
|
||||
int wxWindowMSW::GetScrollPage(int orient) const
|
||||
{
|
||||
return orient == wxHORIZONTAL ? m_xThumbSize : m_yThumbSize;
|
||||
}
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
inline int GetScrollPosition(HWND hWnd, int wOrient)
|
||||
{
|
||||
#ifdef __WXMICROWIN__
|
||||
@@ -1192,37 +1144,6 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
|
||||
return style;
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// If nothing defined for this, try the parent.
|
||||
// E.g. we may be a button loaded from a resource, with no callback function
|
||||
// defined.
|
||||
void wxWindowMSW::OnCommand(wxWindow& win, wxCommandEvent& event)
|
||||
{
|
||||
if ( GetEventHandler()->ProcessEvent(event) )
|
||||
return;
|
||||
if ( m_parent )
|
||||
m_parent->GetEventHandler()->OnCommand(win, event);
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxObject* wxWindowMSW::GetChild(int number) const
|
||||
{
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
wxNode *node = GetChildren().First();
|
||||
int n = number;
|
||||
while (node && n--)
|
||||
node = node->Next();
|
||||
if ( node )
|
||||
{
|
||||
wxObject *obj = (wxObject *)node->Data();
|
||||
return(obj);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
void wxWindowMSW::SetupColours()
|
||||
{
|
||||
@@ -1714,48 +1635,6 @@ void wxWindowMSW::GetTextExtent(const wxString& string,
|
||||
*externalLeading = tm.tmExternalLeading;
|
||||
}
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// ---------------------------------------------------------------------------
|
||||
// Caret manipulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxWindowMSW::CreateCaret(int w, int h)
|
||||
{
|
||||
SetCaret(new wxCaret(this, w, h));
|
||||
}
|
||||
|
||||
void wxWindowMSW::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
}
|
||||
|
||||
void wxWindowMSW::ShowCaret(bool show)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to show" );
|
||||
|
||||
m_caret->Show(show);
|
||||
}
|
||||
|
||||
void wxWindowMSW::DestroyCaret()
|
||||
{
|
||||
SetCaret(NULL);
|
||||
}
|
||||
|
||||
void wxWindowMSW::SetCaretPos(int x, int y)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to move" );
|
||||
|
||||
m_caret->Move(x, y);
|
||||
}
|
||||
|
||||
void wxWindowMSW::GetCaretPos(int *x, int *y) const
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to get position of" );
|
||||
|
||||
m_caret->GetPosition(x, y);
|
||||
}
|
||||
#endif // wxUSE_CARET
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// popup menu
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -383,10 +383,6 @@ bool wxBitmap::Create(
|
||||
}
|
||||
SetHBITMAP((WXHBITMAP)hBmp);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
GetBitmapData()->m_bOk = hBmp != 0;
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
return Ok();
|
||||
} // end of wxBitmap::Create
|
||||
|
||||
@@ -1171,17 +1167,6 @@ void wxBitmap::SetQuality(
|
||||
GetBitmapData()->m_nQuality = nQ;
|
||||
} // end of wxBitmap::SetQuality
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
void wxBitmap::SetOk(
|
||||
bool bOk
|
||||
)
|
||||
{
|
||||
EnsureHasData();
|
||||
|
||||
GetBitmapData()->m_bOk = bOk;
|
||||
} // end of wxBitmap::SetOk
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
void wxBitmap::SetPalette(
|
||||
const wxPalette& rPalette
|
||||
)
|
||||
|
@@ -103,20 +103,3 @@ void wxColour::Set (
|
||||
m_bIsInit = TRUE;
|
||||
m_vPixel = OS2RGB (m_cRed, m_cGreen, m_cBlue);
|
||||
} // end of wxColour::Set
|
||||
|
||||
//
|
||||
// Obsolete
|
||||
//
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxColour::Get (
|
||||
unsigned char* pRed
|
||||
, unsigned char* pGreen
|
||||
, unsigned char* pBlue
|
||||
) const
|
||||
{
|
||||
*Red = m_cRed;
|
||||
*Green = m_cGreen;
|
||||
*Blue = m_cBlue;
|
||||
} // end of wxColour::Get
|
||||
#endif
|
||||
|
||||
|
@@ -35,10 +35,6 @@ END_EVENT_TABLE()
|
||||
// Item members
|
||||
wxControl::wxControl()
|
||||
{
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
m_callback = 0;
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
} // end of wxControl::wxControl
|
||||
|
||||
bool wxControl::Create(
|
||||
@@ -186,16 +182,6 @@ wxSize wxControl::DoGetBestSize() const
|
||||
|
||||
bool wxControl::ProcessCommand(wxCommandEvent& event)
|
||||
{
|
||||
#if WXWIN_COMPATIBILITY
|
||||
if ( m_callback )
|
||||
{
|
||||
(void)(*m_callback)(this, event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
|
@@ -691,81 +691,11 @@ void wxWindowOS2::WarpPointer(
|
||||
::WinSetPointerPos(HWND_DESKTOP, (LONG)nX, (LONG)(nY));
|
||||
} // end of wxWindowOS2::WarpPointer
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxWindowOS2::OS2DeviceToLogical (float *x, float *y) const
|
||||
{
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// scrolling stuff
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxWindowOS2::SetScrollRange(
|
||||
int nOrient
|
||||
, int nRange
|
||||
, bool bRefresh
|
||||
)
|
||||
{
|
||||
int nRange1 = nRange;
|
||||
int nPageSize = GetScrollPage(nOrient);
|
||||
|
||||
if (nPpageSize > 1 && nRange > 0)
|
||||
{
|
||||
nRange1 += (nPageSize - 1);
|
||||
}
|
||||
|
||||
if (nOrient == wxHORIZONTAL)
|
||||
{
|
||||
::WinSendMsg(m_hWndScrollBarHorz, SBM_SETSCROLLBAR, (MPARAM)0, MPFROM2SHORT(0, (SHORT)nRange1));
|
||||
::WinSendMsg(m_hWndScrollBarHorz, SBM_SETTHUMBSIZE, MPFROM2SHORT((SHORT)nThumbVisible, (SHORT)nRange1), (MPARAM)0);
|
||||
}
|
||||
else
|
||||
{
|
||||
::WinSendMsg(m_hWndScrollBarVert, SBM_SETSCROLLBAR, (MPARAM)0, MPFROM2SHORT(0, (SHORT)nRange1));
|
||||
::WinSendMsg(m_hWndScrollBarVert, SBM_SETTHUMBSIZE, MPFROM2SHORT((SHORT)nThumbVisible, (SHORT)nRange1), (MPARAM)0);
|
||||
}
|
||||
} // end of wxWindowOS2::SetScrollRange
|
||||
|
||||
void wxWindowOS2::SetScrollPage(
|
||||
int nOrient
|
||||
, int nPage
|
||||
, bool bRefresh
|
||||
)
|
||||
{
|
||||
if (nOrient == wxHORIZONTAL )
|
||||
m_nXThumbSize = nPage;
|
||||
else
|
||||
m_nYThumbSize = nPage;
|
||||
} // end of wxWindowOS2::SetScrollPage
|
||||
|
||||
int wxWindowOS2::OldGetScrollRange(
|
||||
int nOrient
|
||||
) const
|
||||
{
|
||||
MRESULT mRc;
|
||||
HWND hWnd = GetHwnd();
|
||||
|
||||
if (hWnd)
|
||||
{
|
||||
mRc = WinSendMsg(hWnd, SBM_QUERYRANGE, (MPARAM)0L, (MPARAM)0L);
|
||||
return(SHORT2FROMMR(mRc));
|
||||
}
|
||||
return 0;
|
||||
} // end of wxWindowOS2::OldGetScrollRange
|
||||
|
||||
int wxWindowOS2::GetScrollPage(
|
||||
int nOrient
|
||||
) const
|
||||
{
|
||||
if (nOrient == wxHORIZONTAL)
|
||||
return m_nXThumbSize;
|
||||
else
|
||||
return m_nYThumbSize;
|
||||
} // end of wxWindowOS2::GetScrollPage
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
int wxWindowOS2::GetScrollPos(
|
||||
int nOrient
|
||||
) const
|
||||
@@ -1277,43 +1207,6 @@ WXDWORD wxWindowOS2::Determine3DEffects(
|
||||
return dwStyle;
|
||||
} // end of wxWindowOS2::Determine3DEffects
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void wxWindowOS2::OnCommand(
|
||||
wxWindow& rWin
|
||||
, wxCommandEvent& rEvent
|
||||
)
|
||||
{
|
||||
if (GetEventHandler()->ProcessEvent(rEvent))
|
||||
return;
|
||||
if (m_parent)
|
||||
m_parent->GetEventHandler()->OnCommand( rWin
|
||||
,rEvent
|
||||
);
|
||||
} // end of wxWindowOS2::OnCommand
|
||||
|
||||
wxObject* wxWindowOS2::GetChild(
|
||||
int nNumber
|
||||
) const
|
||||
{
|
||||
//
|
||||
// Return a pointer to the Nth object in the Panel
|
||||
//
|
||||
wxNode* pNode = GetChildren().First();
|
||||
int n = nNumber;
|
||||
|
||||
while (pNode && n--)
|
||||
pNode = pNode->Next();
|
||||
if (pNode)
|
||||
{
|
||||
wxObject* pObj = (wxObject*)pNode->Data();
|
||||
return(pObj);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
} // end of wxWindowOS2::GetChild
|
||||
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
//
|
||||
// Setup background and foreground colours correctly
|
||||
//
|
||||
@@ -2137,67 +2030,6 @@ bool wxWindowOS2::IsMouseInWindow() const
|
||||
return hWnd != NULL;
|
||||
} // end of wxWindowOS2::IsMouseInWindow
|
||||
|
||||
#if wxUSE_CARET && WXWIN_COMPATIBILITY
|
||||
// ---------------------------------------------------------------------------
|
||||
// Caret manipulation
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void wxWindowOS2::CreateCaret(
|
||||
int nWidth
|
||||
, int nHeight
|
||||
)
|
||||
{
|
||||
SetCaret(new wxCaret( this
|
||||
,nWidth
|
||||
,nHeight
|
||||
));
|
||||
} // end of wxWindowOS2::CreateCaret
|
||||
|
||||
void wxWindowOS2::CreateCaret(
|
||||
const wxBitmap* pBitmap
|
||||
)
|
||||
{
|
||||
wxFAIL_MSG("not implemented");
|
||||
} // end of wxWindowOS2::CreateCaret
|
||||
|
||||
void wxWindowOS2::ShowCaret(
|
||||
bool bShow
|
||||
)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to show" );
|
||||
|
||||
m_caret->Show(bShow);
|
||||
} // end of wxWindowOS2::ShowCaret
|
||||
|
||||
void wxWindowOS2::DestroyCaret()
|
||||
{
|
||||
SetCaret(NULL);
|
||||
} // end of wxWindowOS2::DestroyCaret
|
||||
|
||||
void wxWindowOS2::SetCaretPos(
|
||||
int nX
|
||||
, int nY)
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to move" );
|
||||
|
||||
m_caret->Move( nX
|
||||
,nY
|
||||
);
|
||||
} // end of wxWindowOS2::SetCaretPos
|
||||
|
||||
void wxWindowOS2::GetCaretPos(
|
||||
int* pX
|
||||
, int* pY
|
||||
) const
|
||||
{
|
||||
wxCHECK_RET( m_caret, "no caret to get position of" );
|
||||
|
||||
m_caret->GetPosition( pX
|
||||
,pY
|
||||
);
|
||||
} // end of wxWindowOS2::GetCaretPos
|
||||
|
||||
#endif //wxUSE_CARET
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// popup menu
|
||||
|
Reference in New Issue
Block a user