}
Rect getFrame () const
{
return area;
}
Rect getScreenRect () const; Point& local2Screen ( Point& ) const; Rect& local2Screen ( Rect& ) const; Point& screen2Local ( Point& ) const; Rect& screen2Local ( Rect& ) const;
void enableView (int = TRUE );
void beginDraw () const;
void endDraw () const;
void repaint () const;
void lock (int flag = TRUE );
View * getFirstTab () const;
void setZOrder (View * behind = NULL ); View * hookWindow ( View * whome );
int containsFocus () const;
char * getText () const {
return text;
}
char * setText ( const char * newText);
View * getParent () const {
return parent;
}
int getStyle () const {
return style;
}
void setStyle (int newStyle ) {
style = newStyle;
}
int getStatus () const {
5. Принципы построения пользовательского интерфейс
return status;
int contains ( const Point& p )
return p.x >= 0 && p.x < width () && p.y >= 0 && p.y < height ();
int width () const return area.width ();
int height () const return area.height ();
int isVisibfe () const
return status & WSJ/ISIBLE;
int isActivateable () const
return style & WS_ACTIVATEABLE;
int isFloating () const
return style & WS_FLOATING;
int isEnabled () const
return status & WS_ENABLED;
int isLocked () const return lockCount > 0;
int isFocused () const
return focusedView == this;
friend class Map;
friend class DialogWindow;
friend int setFocus (View *);
};
Object * loadView (); #endif
Компьютерная графика. Полигональные модели
// File view.cpp //
// Simple windowing system, basic class for all window objects
//
#include <assert.h> #include <dos.h> #include <stdlib.h>
#include "array.h" #include "store.h" #include "view.h"
////////////// Global variables Hilllllllllll
View * deskTop = NULL; View * focusedView = NULL;
Array floaters (10, 10 );
////////////// Objects to manage screen layout //////////////
class Region : public Rect {