Fix scrollview functionality with new inheritance structure

This commit is contained in:
Markus Gans 2017-10-30 20:29:00 +01:00
parent 9b47e5c980
commit b0b44582e8
6 changed files with 39 additions and 13 deletions

View File

@ -1,3 +1,6 @@
2017-10-30 Markus Gans <guru.mail@muenster.de>
* Fix scrollview functionality with new inheritance structure
2017-10-29 Markus Gans <guru.mail@muenster.de>
* Adaptation of the inheritance diagrams in the header files
* Add a standardized cb_exitApp callback method to FApplication

View File

@ -213,9 +213,9 @@ class FVTerm : public FTerm
static void putVTerm();
static void updateTerminal (bool);
static void updateTerminal();
void addPreprocessingHandler ( FVTerm*
virtual void addPreprocessingHandler ( FVTerm*
, FPreprocessingHandler );
void delPreprocessingHandler (FVTerm*);
virtual void delPreprocessingHandler (FVTerm*);
int printf (const wchar_t*, ...);
int printf (const char*, ...)

View File

@ -114,7 +114,7 @@ class FMenuBar;
#pragma pack(push)
#pragma pack(1)
class FWidget : public FObject, public FVTerm
class FWidget : public FVTerm, public FObject
{
public:
// Using-declaration
@ -320,6 +320,9 @@ class FWidget : public FObject, public FVTerm
// Accessor
term_area* getPrintArea();
void addPreprocessingHandler ( FVTerm*
, FPreprocessingHandler );
void delPreprocessingHandler (FVTerm*);
// Inquiry
bool isChildPrintArea() const;

View File

@ -668,7 +668,7 @@ FVTerm::term_area* FScrollView::getPrintArea()
if ( use_own_print_area || ! viewport )
{
child_print_area = 0;
term_area* area = FVTerm::getPrintArea();
term_area* area = FWidget::getPrintArea();
child_print_area = viewport;
return area;
}
@ -717,7 +717,7 @@ void FScrollView::copy2area()
// copy viewport to area
if ( ! hasPrintArea() )
FVTerm::getPrintArea();
FWidget::getPrintArea();
if ( ! (hasPrintArea() && viewport) )
return;

View File

@ -2207,8 +2207,8 @@ void FVTerm::flush_out()
void FVTerm::init()
{
init_object = this;
vterm = 0;
vdesktop = 0;
vterm = 0;
vdesktop = 0;
try
{

View File

@ -53,8 +53,8 @@ bool FWidget::hideable;
// constructors and destructor
//----------------------------------------------------------------------
FWidget::FWidget (FWidget* parent, bool disable_alt_screen)
: FObject(parent)
, FVTerm(!parent, disable_alt_screen)
: FVTerm(bool(! parent), disable_alt_screen)
, FObject(parent)
, accelerator_list(0)
, flags(0)
, callback_objects()
@ -1767,14 +1767,15 @@ FVTerm::term_area* FWidget::getPrintArea()
return print_area;
else
{
FWidget* obj = this;
FWidget* p_obj = static_cast<FWidget*>(obj->getParent());
FWidget* obj;
FWidget* p_obj = this;
while ( ! obj->vwin && ! obj->child_print_area && p_obj )
do
{
obj = p_obj;
p_obj = static_cast<FWidget*>(p_obj->getParent());
p_obj = static_cast<FWidget*>(obj->getParent());
}
while ( ! obj->vwin && ! obj->child_print_area && p_obj );
if ( obj->vwin )
{
@ -1791,6 +1792,25 @@ FVTerm::term_area* FWidget::getPrintArea()
return vdesktop;
}
//----------------------------------------------------------------------
void FWidget::addPreprocessingHandler ( FVTerm* instance
, FPreprocessingHandler handler )
{
if ( ! print_area )
FWidget::getPrintArea();
FVTerm::addPreprocessingHandler (instance, handler);
}
//----------------------------------------------------------------------
void FWidget::delPreprocessingHandler (FVTerm* instance)
{
if ( ! print_area )
FWidget::getPrintArea();
FVTerm::delPreprocessingHandler (instance);
}
//----------------------------------------------------------------------
bool FWidget::isChildPrintArea() const
{