Patch level : 2.1 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Velocizzata gestione display context di stampa git-svn-id: svn://10.65.10.50/trunk@12213 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f6f9e3b3dc
commit
079b3078b5
@ -731,6 +731,8 @@ BEGIN_EVENT_TABLE(TwxWindow, TwxWindowBase)
|
||||
EVT_LEFT_DOWN(TwxWindow::OnMouseDown)
|
||||
EVT_LEFT_UP(TwxWindow::OnMouseUp)
|
||||
EVT_MENU_RANGE(1000, 32766, TwxWindow::OnMenu)
|
||||
EVT_MIDDLE_DOWN(TwxWindow::OnMouseDown)
|
||||
EVT_MIDDLE_UP(TwxWindow::OnMouseUp)
|
||||
EVT_MOTION(TwxWindow::OnMouseMove)
|
||||
EVT_MOUSEWHEEL(TwxWindow::OnMouseWheel)
|
||||
EVT_PAINT(TwxWindow::OnPaint)
|
||||
@ -893,7 +895,7 @@ void TwxWindow::OnMouseDouble(wxMouseEvent& event)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_MOUSE_DBL;
|
||||
e.v.mouse.button = 0;
|
||||
e.v.mouse.button = (event.RightDown() ? 1 : 0) + (event.MiddleDown() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.ShiftDown();
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
@ -905,7 +907,7 @@ void TwxWindow::OnMouseDown(wxMouseEvent& event)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_MOUSE_DOWN;
|
||||
e.v.mouse.button = event.RightDown() ? 1 : 0;
|
||||
e.v.mouse.button = (event.RightDown() ? 1 : 0) + (event.MiddleDown() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.ShiftDown();
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
@ -917,6 +919,7 @@ void TwxWindow::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_MOUSE_MOVE;
|
||||
e.v.mouse.button = (event.RightIsDown() ? 1 : 0) + (event.MiddleIsDown() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.m_shiftDown;
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
@ -928,7 +931,7 @@ void TwxWindow::OnMouseUp(wxMouseEvent& event)
|
||||
{
|
||||
EVENT e; memset(&e, 0, sizeof(EVENT));
|
||||
e.type = E_MOUSE_UP;
|
||||
e.v.mouse.button = event.RightUp() ? 1 : 0;
|
||||
e.v.mouse.button = (event.RightUp() ? 1 : 0) + (event.MiddleUp() ? 2 : 0);
|
||||
e.v.mouse.control = event.ControlDown();
|
||||
e.v.mouse.shift = event.ShiftDown();
|
||||
e.v.mouse.where.h = event.GetX();
|
||||
|
@ -76,7 +76,11 @@ public:
|
||||
|
||||
class TPrintDC : public TDC
|
||||
{
|
||||
static bool _page_start;
|
||||
|
||||
public:
|
||||
static void SetPageStart();
|
||||
|
||||
virtual wxDC& GetDC(bool);
|
||||
virtual void KillDC();
|
||||
TPrintDC(wxWindow* owner);
|
||||
|
@ -390,11 +390,20 @@ TwxPrintOut* TwxPrintOutCache::Get(TPRINT_RCD* prcd)
|
||||
// TPrintDC
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// Flag di reset ad inizio pagina
|
||||
bool TPrintDC::_page_start = false;
|
||||
|
||||
void TPrintDC::SetPageStart()
|
||||
{ _page_start = true; }
|
||||
|
||||
wxDC& TPrintDC::GetDC(bool)
|
||||
{
|
||||
_dc = m_po->GetDC(); // Forza display context corrente
|
||||
if (_dirty)
|
||||
_dirty = -1;
|
||||
if (_page_start)
|
||||
{
|
||||
_dirty = -1;
|
||||
_page_start = false;
|
||||
}
|
||||
return TDC::GetDC(false);
|
||||
}
|
||||
|
||||
@ -404,11 +413,13 @@ void TPrintDC::KillDC()
|
||||
}
|
||||
|
||||
TPrintDC::TPrintDC(wxWindow* owner) : TDC(owner)
|
||||
{ }
|
||||
{
|
||||
_page_start = false;
|
||||
}
|
||||
|
||||
TPrintDC::~TPrintDC()
|
||||
{
|
||||
_dc = NULL; // Evita distruzione!
|
||||
KillDC();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
@ -761,7 +772,10 @@ BOOLEAN xvt_print_open_page(PRINT_RCD* precp)
|
||||
if (wxPrinterBase::sm_abortIt)
|
||||
ok = FALSE;
|
||||
else
|
||||
{
|
||||
m_po->GetDC()->StartPage();
|
||||
TPrintDC::SetPageStart(); // Flag per azzeramento dati DC
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user