Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::PanUser Class Reference

Brief class to provide useful stuff for elements that use a PanController. More...

Inheritance diagram for Laxkit::PanUser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 PanUser (PanController *npan=NULL)
 Create with a new panner.
virtual ~PanUser ()
 Removes this from panner tellstack. Delete panner if necessary.
virtual PanControllercreateNewPanner (PanController *pan=NULL)
 Create a new panner that is a copy of pan if given.
virtual void UseThisPanner (PanController *npanner)
 Replace the current panner with npanner, which can be NULL to mean make a new one.

Public Attributes

PanControllerpanner

Detailed Description

Brief class to provide useful stuff for elements that use a PanController.

Classes derived from this one inherit these panner goodies. See for instance, Scroller, ScrolledWindow, PanPopup, PanWindow. For derived classes, make sure to inherit from the PanUser BEFORE a window class, otherwise the destructor will not function properly.

Todo:

***If this is made over to be anObject derived, then must ensure that all derived classes do ClassBlah : virtual ... PanUser, in any case, make sure that all the other classes derive properly (public vs. protected?)

*** maybe make the panner protected, functions public?


Constructor & Destructor Documentation

Laxkit::PanUser::PanUser ( PanController npan = NULL)

Create with a new panner.

A PanUser will never leave the constructor without a valid panner. panner will not be NULL. Calls UseThisPanner(npan).

References UseThisPanner().

Laxkit::PanUser::~PanUser ( )
virtual

Removes this from panner tellstack. Delete panner if necessary.

This transparently handles PanUsers being deleted BEFORE the panner.

IMPORTANT: For this destructing mechanism to work, in your class definition of the PanUser-derived class, you MUST declare the PanUser BEFORE the window part, otherwise the PanUser will not pop itself from the panner->tellstack here, since the window portion will have been destroyed, and it cannot cast itself to an anXWindow anymore.

References Laxkit::anObject::dec_count(), and Laxkit::PanController::tellPop().


Member Function Documentation

void Laxkit::PanUser::UseThisPanner ( PanController npanner)
virtual

Replace the current panner with npanner, which can be NULL to mean make a new one.

This will always cause panner to point to a PanController. panner will not be NULL afterwards.

The old is dec_counted, the new inc_counted.

If this can be cast to anXWindow, then call this->Needtodraw(1), and add this to panner->tellstack.

Reimplemented in Laxkit::Displayer, and Laxkit::PanWindow.

References createNewPanner(), Laxkit::anObject::dec_count(), Laxkit::anObject::inc_count(), and Laxkit::PanController::tell().

Referenced by PanUser(), and LaxInterfaces::ViewportWindow::UseTheseScrollers().


The documentation for this class was generated from the following files:

Mon Feb 17 2014 11:53:00, Laxkit