Fixes for WXWIN_COMPATIBILITY, and BC++ fix for event.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -400,7 +400,7 @@ class WXDLLEXPORT wxDocParentFrame: public wxFrame
|
|||||||
public:
|
public:
|
||||||
wxDocParentFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title,
|
wxDocParentFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
long type = wxDEFAULT_FRAME, const wxString& name = "frame");
|
long type = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
|
||||||
|
|
||||||
// Extend event processing to search the document manager's event table
|
// Extend event processing to search the document manager's event table
|
||||||
virtual bool ProcessEvent(wxEvent& event);
|
virtual bool ProcessEvent(wxEvent& event);
|
||||||
|
@@ -40,10 +40,10 @@ class WXDLLEXPORT wxGenericColourDialog: public wxDialog
|
|||||||
wxRect singleCustomColourRect;
|
wxRect singleCustomColourRect;
|
||||||
|
|
||||||
// Size of each colour rectangle
|
// Size of each colour rectangle
|
||||||
wxIntPoint smallRectangleSize;
|
wxPoint smallRectangleSize;
|
||||||
|
|
||||||
// For single customizable colour
|
// For single customizable colour
|
||||||
wxIntPoint customRectangleSize;
|
wxPoint customRectangleSize;
|
||||||
|
|
||||||
// Grid spacing (between rectangles)
|
// Grid spacing (between rectangles)
|
||||||
int gridSpacing;
|
int gridSpacing;
|
||||||
|
@@ -115,6 +115,8 @@ public:
|
|||||||
DrawIcon(icon, pt.x, pt.y);
|
DrawIcon(icon, pt.x, pt.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE );
|
||||||
|
|
||||||
inline void DrawPoint(wxPoint& point) { DrawPoint(point.x, point.y); }
|
inline void DrawPoint(wxPoint& point) { DrawPoint(point.x, point.y); }
|
||||||
virtual void DrawLines(wxList *list, long xoffset = 0, long yoffset = 0);
|
virtual void DrawLines(wxList *list, long xoffset = 0, long yoffset = 0);
|
||||||
virtual void DrawPolygon(wxList *list, long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
virtual void DrawPolygon(wxList *list, long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
||||||
|
@@ -170,7 +170,7 @@ class WXDLLEXPORT wxPreviewFrame: public wxFrame
|
|||||||
public:
|
public:
|
||||||
wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title = "Print Preview",
|
wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title = "Print Preview",
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
long style = wxDEFAULT_FRAME, const wxString& name = "frame");
|
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame");
|
||||||
~wxPreviewFrame();
|
~wxPreviewFrame();
|
||||||
|
|
||||||
bool OnClose();
|
bool OnClose();
|
||||||
|
@@ -371,7 +371,9 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
int commandId = event.GetId();
|
int commandId = event.GetId();
|
||||||
|
|
||||||
while (table.entries[i].m_fn)
|
// BC++ doesn't like while (table.entries[i].m_fn)
|
||||||
|
|
||||||
|
while (table.entries[i].m_fn != 0L)
|
||||||
{
|
{
|
||||||
if ((event.GetEventType() == table.entries[i].m_eventType) &&
|
if ((event.GetEventType() == table.entries[i].m_eventType) &&
|
||||||
(table.entries[i].m_id == -1 || // Match, if event spec says any id will do (id == -1)
|
(table.entries[i].m_id == -1 || // Match, if event spec says any id will do (id == -1)
|
||||||
|
@@ -379,10 +379,15 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
|
|||||||
{
|
{
|
||||||
control = new wxScrollBar(parent, id, pos, size,
|
control = new wxScrollBar(parent, id, pos, size,
|
||||||
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
|
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
|
||||||
|
/*
|
||||||
((wxScrollBar *)control)->SetValue((int)childResource->GetValue1());
|
((wxScrollBar *)control)->SetValue((int)childResource->GetValue1());
|
||||||
((wxScrollBar *)control)->SetPageSize((int)childResource->GetValue2());
|
((wxScrollBar *)control)->SetPageSize((int)childResource->GetValue2());
|
||||||
((wxScrollBar *)control)->SetObjectLength((int)childResource->GetValue3());
|
((wxScrollBar *)control)->SetObjectLength((int)childResource->GetValue3());
|
||||||
((wxScrollBar *)control)->SetViewLength((int)(long)childResource->GetValue5());
|
((wxScrollBar *)control)->SetViewLength((int)(long)childResource->GetValue5());
|
||||||
|
*/
|
||||||
|
((wxScrollBar *)control)->SetScrollbar((int)childResource->GetValue1(),(int)childResource->GetValue2(),
|
||||||
|
(int)childResource->GetValue3(),(int)(long)childResource->GetValue5(),FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (itemType == wxString("wxSlider"))
|
else if (itemType == wxString("wxSlider"))
|
||||||
@@ -1834,7 +1839,8 @@ static wxResourceBitListStruct wxResourceBitListTable[] =
|
|||||||
{ "wxMINIMIZE_BOX", wxMINIMIZE_BOX},
|
{ "wxMINIMIZE_BOX", wxMINIMIZE_BOX},
|
||||||
{ "wxMAXIMIZE_BOX", wxMAXIMIZE_BOX},
|
{ "wxMAXIMIZE_BOX", wxMAXIMIZE_BOX},
|
||||||
{ "wxRESIZE_BOX", wxRESIZE_BOX},
|
{ "wxRESIZE_BOX", wxRESIZE_BOX},
|
||||||
{ "wxDEFAULT_FRAME", wxDEFAULT_FRAME},
|
{ "wxDEFAULT_FRAME_STYLE", wxDEFAULT_FRAME_STYLE},
|
||||||
|
{ "wxDEFAULT_FRAME", wxDEFAULT_FRAME_STYLE},
|
||||||
{ "wxDEFAULT_DIALOG_STYLE", wxDEFAULT_DIALOG_STYLE},
|
{ "wxDEFAULT_DIALOG_STYLE", wxDEFAULT_DIALOG_STYLE},
|
||||||
{ "wxBORDER", wxBORDER},
|
{ "wxBORDER", wxBORDER},
|
||||||
{ "wxRETAINED", wxRETAINED},
|
{ "wxRETAINED", wxRETAINED},
|
||||||
|
@@ -181,7 +181,7 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
int nScrollInc = 0;
|
int nScrollInc = 0;
|
||||||
switch (event.GetEventType())
|
switch (event.GetEventType())
|
||||||
{
|
{
|
||||||
case wxEVENT_TYPE_SCROLL_TOP:
|
case wxEVT_SCROLL_TOP:
|
||||||
{
|
{
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
nScrollInc = - m_xScrollPosition;
|
nScrollInc = - m_xScrollPosition;
|
||||||
@@ -189,7 +189,7 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
nScrollInc = - m_yScrollPosition;
|
nScrollInc = - m_yScrollPosition;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_BOTTOM:
|
case wxEVT_SCROLL_BOTTOM:
|
||||||
{
|
{
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
nScrollInc = m_xScrollLines - m_xScrollPosition;
|
nScrollInc = m_xScrollLines - m_xScrollPosition;
|
||||||
@@ -197,17 +197,17 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
nScrollInc = m_yScrollLines - m_yScrollPosition;
|
nScrollInc = m_yScrollLines - m_yScrollPosition;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_LINEUP:
|
case wxEVT_SCROLL_LINEUP:
|
||||||
{
|
{
|
||||||
nScrollInc = -1;
|
nScrollInc = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_LINEDOWN:
|
case wxEVT_SCROLL_LINEDOWN:
|
||||||
{
|
{
|
||||||
nScrollInc = 1;
|
nScrollInc = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_PAGEUP:
|
case wxEVT_SCROLL_PAGEUP:
|
||||||
{
|
{
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
|
nScrollInc = -GetScrollPageSize(wxHORIZONTAL);
|
||||||
@@ -215,7 +215,7 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
nScrollInc = -GetScrollPageSize(wxVERTICAL);
|
nScrollInc = -GetScrollPageSize(wxVERTICAL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_PAGEDOWN:
|
case wxEVT_SCROLL_PAGEDOWN:
|
||||||
{
|
{
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
nScrollInc = GetScrollPageSize(wxHORIZONTAL);
|
nScrollInc = GetScrollPageSize(wxHORIZONTAL);
|
||||||
@@ -223,7 +223,7 @@ int wxScrolledWindow::CalcScrollInc(wxScrollEvent& event)
|
|||||||
nScrollInc = GetScrollPageSize(wxVERTICAL);
|
nScrollInc = GetScrollPageSize(wxVERTICAL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case wxEVENT_TYPE_SCROLL_THUMBTRACK:
|
case wxEVT_SCROLL_THUMBTRACK:
|
||||||
{
|
{
|
||||||
if (orient == wxHORIZONTAL)
|
if (orient == wxHORIZONTAL)
|
||||||
nScrollInc = pos - m_xScrollPosition;
|
nScrollInc = pos - m_xScrollPosition;
|
||||||
|
@@ -33,7 +33,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
|
|||||||
|
|
||||||
bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id))
|
||||||
{
|
{
|
||||||
wxCommandEvent event(wxEVENT_TYPE_CHECKBOX_COMMAND, m_windowId);
|
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId);
|
||||||
event.SetInt(GetValue());
|
event.SetInt(GetValue());
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
ProcessCommand(event);
|
ProcessCommand(event);
|
||||||
|
@@ -604,6 +604,45 @@ void wxDC::DrawIcon(const wxIcon& icon, long x, long y)
|
|||||||
CalcBoundingBox(x+icon.GetWidth(), y+icon.GetHeight());
|
CalcBoundingBox(x+icon.GetWidth(), y+icon.GetHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxDC::DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask )
|
||||||
|
{
|
||||||
|
if (!bmp.Ok())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If we're not drawing transparently, and not drawing to a printer,
|
||||||
|
// optimize this function to use Windows functions.
|
||||||
|
if (!useMask && !IsKindOf(CLASSINFO(wxPrinterDC)))
|
||||||
|
{
|
||||||
|
HDC cdc = (HDC)m_hDC;
|
||||||
|
HDC memdc = ::CreateCompatibleDC( cdc );
|
||||||
|
HBITMAP hbitmap = (HBITMAP) bmp.GetHBITMAP( );
|
||||||
|
::SelectObject( memdc, hbitmap );
|
||||||
|
::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY);
|
||||||
|
::SelectObject( memdc, 0 );
|
||||||
|
::DeleteDC( memdc );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Rather than reproduce wxDC::Blit, let's do it at the wxWin API level
|
||||||
|
wxMemoryDC memDC;
|
||||||
|
memDC.SelectObject(bmp);
|
||||||
|
|
||||||
|
/* Not sure if we need this. The mask should leave the
|
||||||
|
* masked areas as per the original background of this DC.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
// There might be transparent areas, so make these
|
||||||
|
// the same colour as this DC
|
||||||
|
memDC.SetBackground(* GetBackground());
|
||||||
|
memDC.Clear();
|
||||||
|
*/
|
||||||
|
|
||||||
|
Blit(x, y, bmp.GetWidth(), bmp.GetHeight(), & memDC, 0, 0, wxCOPY, useMask);
|
||||||
|
|
||||||
|
memDC.SelectObject(wxNullBitmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxDC::SetFont(const wxFont& the_font)
|
void wxDC::SetFont(const wxFont& the_font)
|
||||||
{
|
{
|
||||||
// Set the old object temporarily, in case the assignment deletes an object
|
// Set the old object temporarily, in case the assignment deletes an object
|
||||||
@@ -1256,7 +1295,7 @@ bool wxDC::Blit(long xdest, long ydest, long width, long height,
|
|||||||
{
|
{
|
||||||
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
if (IsKindOf(CLASSINFO(wxPrinterDC)))
|
||||||
{
|
{
|
||||||
// If we are printing source colours are screen colours
|
// If we are printing, source colours are screen colours
|
||||||
// not printer colours and so we need copy the bitmap
|
// not printer colours and so we need copy the bitmap
|
||||||
// pixel by pixel.
|
// pixel by pixel.
|
||||||
HDC dc_src = (HDC) source->m_hDC;
|
HDC dc_src = (HDC) source->m_hDC;
|
||||||
|
@@ -920,7 +920,7 @@ void wxFrame::Command(int id)
|
|||||||
|
|
||||||
void wxFrame::ProcessCommand(int id)
|
void wxFrame::ProcessCommand(int id)
|
||||||
{
|
{
|
||||||
wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id);
|
wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, id);
|
||||||
commandEvent.SetInt( id );
|
commandEvent.SetInt( id );
|
||||||
commandEvent.SetEventObject( this );
|
commandEvent.SetEventObject( this );
|
||||||
|
|
||||||
|
@@ -413,7 +413,7 @@ wxString wxMenu::GetLabel(int id) const
|
|||||||
|
|
||||||
bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id)
|
bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id)
|
||||||
{
|
{
|
||||||
wxCommandEvent event(wxEVENT_TYPE_MENU_COMMAND);
|
wxCommandEvent event(wxEVT_COMMAND_MENU_SELECTED);
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
event.SetId( id );
|
event.SetId( id );
|
||||||
event.SetInt( id );
|
event.SetInt( id );
|
||||||
|
@@ -2069,7 +2069,7 @@ void wxWindow::MSWOnLButtonDown(int x, int y, WXUINT flags)
|
|||||||
event.SetTimestamp(wxApp::sm_lastMessageTime);
|
event.SetTimestamp(wxApp::sm_lastMessageTime);
|
||||||
event.m_eventObject = this;
|
event.m_eventObject = this;
|
||||||
|
|
||||||
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVENT_TYPE_LEFT_DOWN;
|
m_lastXPos = event.m_x; m_lastYPos = event.m_y; m_lastEvent = wxEVT_LEFT_DOWN;
|
||||||
|
|
||||||
if (!GetEventHandler()->ProcessEvent(event))
|
if (!GetEventHandler()->ProcessEvent(event))
|
||||||
Default();
|
Default();
|
||||||
|
Reference in New Issue
Block a user