home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
msj
/
v10n08
/
sketchsc.exe
/
DATA.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-01
|
3KB
|
82 lines
//-----------------------------------------------------------------------
// DATA.H: Definitions for the data_interface (document) class
//-----------------------------------------------------------------------
#ifndef DATA_H__
#define DATA_H__
#include "stroke.h"
// sketcdoc.h : interface of the CSketchDoc class
//-----------------------------------------------------------------------
// Since the mapping mode controls the "document" coordinate system,
// it makes sense to store it here. As a concequence, the document
// will have to prepare mapping-mode componants of the DC. The main
// advantage is that all views into this document are then guaranteed
// to use the same mapping mode.
class data_interface : public CDocument
{
private:
enum element_type { a_stroke, a_line };
enum pen_width { thin = 2, thick = 5 };
enum Serialize_schema{ version = 1 };
enum default_sizes { hor_size=800, vert_size=800 };
enum map_mode { mapping_mode = MM_TEXT };
unsigned use_thick_lines : 1;
unsigned element_in_use : 1; // Holds an element_type
CSize doc_size ;
CTypedPtrList<CObList,drawing_element*> dwg_objects;
protected:
data_interface(); // created by CView, not by user
virtual ~data_interface(); // so constructor/destuctor
// are private.
DECLARE_DYNCREATE(data_interface)
private:
//{{AFXVIRTUAL(data_interface)
virtual BOOL OnNewDocument ( void );
virtual void Serialize (CArchive& ar);
virtual void DeleteContents (void);
//}}AFXVIRTUAL
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
public: // interface to the view
drawing_element *give_me_an_empty_drawing_element( void );
void am_done_loading( CWnd *src, drawing_element *p );
void print_all_objects_in_this_rect ( device *dc,
const CRect &print_area,
int as_text );
void set_up_scrolling ( CScrollView *view ) const;
private: // menu-message handlers
//{{AFX_MSG(data_interface)
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
afx_msg void OnEditClearAll();
afx_msg void OnUpdateEditClearAll(CCmdUI* pCmdUI);
afx_msg void on_line_thick( void );
afx_msg void on_update_thick( CCmdUI *line_item );
//}}AFX_MSG
afx_msg void on_select_element ( UINT id );
afx_msg void on_update_select_element( CCmdUI *line_item );
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
#endif // DATA_H__