#i92516# support wheel for preview forward/backward
This commit is contained in:
parent
2564edcb1c
commit
c2a9d1f422
2 changed files with 54 additions and 2 deletions
|
@ -73,6 +73,7 @@ namespace vcl
|
|||
virtual ~PrintPreviewWindow();
|
||||
|
||||
virtual void Paint( const Rectangle& rRect );
|
||||
virtual void Command( const CommandEvent& );
|
||||
|
||||
void setPreview( const GDIMetaFile& );
|
||||
void setScale( double fScaleX, double fScaleY );
|
||||
|
@ -194,6 +195,7 @@ namespace vcl
|
|||
|
||||
virtual void Resize();
|
||||
virtual void Paint( const Rectangle& );
|
||||
virtual void Command( const CommandEvent& );
|
||||
|
||||
DECL_LINK( SelectHdl, ListBox* );
|
||||
DECL_LINK( ClickHdl, Button* );
|
||||
|
@ -212,6 +214,9 @@ namespace vcl
|
|||
bool isPrintToFile();
|
||||
int getCopyCount();
|
||||
bool isCollate();
|
||||
|
||||
void previewForward();
|
||||
void previewBackward();
|
||||
};
|
||||
|
||||
class PrintProgressDialog : public ModelessDialog
|
||||
|
|
|
@ -97,6 +97,26 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& i_rRect )
|
|||
Pop();
|
||||
}
|
||||
|
||||
void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt )
|
||||
{
|
||||
if( rEvt.GetCommand() == COMMAND_WHEEL )
|
||||
{
|
||||
const CommandWheelData* pWheelData = rEvt.GetWheelData();
|
||||
PrintDialog* pDlg = dynamic_cast<PrintDialog*>(GetParent());
|
||||
if( pDlg )
|
||||
{
|
||||
if( pWheelData->GetDelta() > 0 )
|
||||
pDlg->previewForward();
|
||||
else if( pWheelData->GetDelta() < 0 )
|
||||
pDlg->previewBackward();
|
||||
/*
|
||||
else
|
||||
huh ?
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview )
|
||||
{
|
||||
maMtf = i_rNewPreview;
|
||||
|
@ -1276,11 +1296,11 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
|
|||
}
|
||||
else if( pButton == &maForwardBtn )
|
||||
{
|
||||
maPageEdit.Up();
|
||||
previewForward();
|
||||
}
|
||||
else if( pButton == &maBackwardBtn )
|
||||
{
|
||||
maPageEdit.Down();
|
||||
previewBackward();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1456,6 +1476,22 @@ void PrintDialog::Paint( const Rectangle& i_rRect )
|
|||
#endif
|
||||
}
|
||||
|
||||
void PrintDialog::Command( const CommandEvent& rEvt )
|
||||
{
|
||||
if( rEvt.GetCommand() == COMMAND_WHEEL )
|
||||
{
|
||||
const CommandWheelData* pWheelData = rEvt.GetWheelData();
|
||||
if( pWheelData->GetDelta() > 0 )
|
||||
previewForward();
|
||||
else if( pWheelData->GetDelta() < 0 )
|
||||
previewBackward();
|
||||
/*
|
||||
else
|
||||
huh ?
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
void PrintDialog::Resize()
|
||||
{
|
||||
Size aPixDiff( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) );
|
||||
|
@ -1512,6 +1548,16 @@ void PrintDialog::Resize()
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
void PrintDialog::previewForward()
|
||||
{
|
||||
maPageEdit.Up();
|
||||
}
|
||||
|
||||
void PrintDialog::previewBackward()
|
||||
{
|
||||
maPageEdit.Down();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// PrintProgressDialog
|
||||
|
@ -1635,3 +1681,4 @@ void PrintProgressDialog::Paint( const Rectangle& )
|
|||
aDecoView.DrawFrame( aFrameRect );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue