UPLOAD - DOSUIT07.ZIP - POPWIN.HPP

 
Output of file : POPWIN.HPP contained in archive : DOSUIT07.ZIP

// Pop-in Window for browsing Lists, Menus etc.
#ifndef POPWIN_HPP
#define POPWIN_HPP
#ifndef WINDOW+HPP
#include "window.hpp"
#endif

/*
A Window which pops in near a Point or VObject on the screen.
*/
class SubWindow : public Window {
public:
SubWindow(VObject *v,const ColorSet &c = defaultColors,
AlignFlag a = AlignFlag(AFVtop|AFHleft),const char *n = "SubWindow");
// A SubWindow containing the VObject.

void popin(coord x,coord y);
// Pop the SubWindow onto the screen near the specified coordinates.
void popin(const Point &p) { popin(p.x,p.y); }
// Pop the SubWindow onto the screen near the specified coordinates.
void popin(VObject *v);
// Pop the SubWindow onto the screen near the specified VObject.
void popout() { removeWindow(); }
// Remove the SubWindow from the screen.

virtual void contentsSet(VObject* o,ControlFlag f);
virtual void setwidth(const coord w);
virtual void setheight(const coord h);
};

/*
A pop-up Window. Used (for example) in TextEdits for the pop-down
browse list. A PopWindow automatically removes itself if the user
presses Escape or clicks with the right mouse button, or if the
PopWindow loses the focus.
*/
class PopWindow : public SubWindow {
public:
PopWindow(VObject *v,const ColorSet &c = defaultColors,
AlignFlag a = AlignFlag(AFVtop|AFHleft),const char *n = "PopWindow");
// A PopWindow containing the VObject.

int inspecting() const
{
#ifndef NINSPECT
return inspectct;
#else
return 0;
#endif
}
void resetfocus();

virtual int inspectclick(MouseEvent &e);
virtual int rightclick(MouseEvent &e);
virtual int kbdevent(KeyboardEvent &e);

private:
int inspectct;
};

#endif