home *** CD-ROM | disk | FTP | other *** search
- #ifndef __VFBLOAD_H__
- #define __VFBLOAD_H__
-
- #include "VfUtil.h"
- #include "VCtl.h"
-
-
- #define VFB_IDENTIFIER _T("VForm Builder")
- #define VFB_VERSION_0x1 _T("0.1")
- #define VFB_VERSION_1x0 _T("1.0")
- #define CURRENT_VFB_VERSION _T("1.0")
-
- #define VFBMODE_FORM 0
- #define VFBMODE_REPORT 1
- #define VFBMODE_GRID 2
-
- class VForm;
-
- /////////////////////////////////////////////////////////////////////////////
- // VfbCtl - base class for all Vfb Controls
-
- class VfbCtl : public CObject
- {
- protected:
- DECLARE_SERIAL(VfbCtl);
- VfbCtl() {};
-
- public:
- virtual void Serialize(CArchive& ar);
- virtual int IsA() { return VCTL_BASE; }
-
- // Attributes
- CRect m_position; // Actual position of control within section
-
- CString m_name; // Name of control
- CString m_refId; // Reference name - use to link data source
- long m_nId; // ID
- CString m_text; // Text of control
- CString m_helpText; // Help text for the control
- VColor m_vclrFore; // Foreground Color
- VColor m_vclrBack; // Background Color
- VColor m_vclrBorder; // Border Color
- CString m_gridCaption; // Grid Caption
- int m_nGridWidth; // Grid Width
- BOOL m_bVisible; // TRUE if Visible
- BOOL m_bTabstop; // TRUE if control recieves focus
- BOOL m_bLocked; // TRUE if control is locked
- BOOL m_bUseInGrid; // TRUE if control is used in Grid Mode
- int m_nLeftMargin; // Width of the left margin for the control
- int m_nEffect; // The effect this control uses
- int m_nEffectDepth; // The depth of the effect
- BOOL m_bBorder; // TRUE if control has a border
- BOOL m_bNoInactiveBorder; // TRUE for no border when inactive
- BOOL m_bTransparent; // TRUE for a transparent control
- CString m_font; // Font Name
- int m_nFontSize; // Font Size in points
- BOOL m_bFontBold; // TRUE if font is BOLD
- BOOL m_bFontItalic; // TRUE if font is italic
- BOOL m_bFontUnderline; // TRUE if font is underlined
- UINT m_nJustify; // Text justification
- };
-
- // special 'list' class for this application (requires afxtempl.h)
- typedef CTypedPtrList<CObList, VfbCtl*> VfbCtlList;
-
- ////////////////////////////////////////////////////////////////////////
- // specialized draw objects
-
-
- // -------------------------------------------------------------------------
- // VfbStatic
- // -------------------------------------------------------------------------
- class VfbStatic : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbStatic);
- VfbStatic() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_STATIC; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbEdit
- // -------------------------------------------------------------------------
- class VfbEdit : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbEdit);
- VfbEdit() {};
-
- public:
- int m_nEditType;
- BOOL m_bMultiLine;
- CString m_mask;
- int m_nDigits;
- int m_nDecimals;
- BOOL m_bDollarSign;
- BOOL m_bAddCommas;
- BOOL m_bAllowNeg;
- int m_nLimitText;
- BOOL m_bReadOnly;
- BOOL m_bPassword;
- BOOL m_bNumeric;
- TCHAR m_cCase;
- BOOL m_bSysBackWhenActive;
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_EDIT; }
- virtual void Serialize(CArchive& ar);
- };
-
-
-
- // -------------------------------------------------------------------------
- // VfbButton
- // -------------------------------------------------------------------------
- class VfbButton : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbButton);
- VfbButton() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_BUTTON; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbCheckBox
- // -------------------------------------------------------------------------
- class VfbCheckBox : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbCheckBox);
- VfbCheckBox() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_CHECKBOX; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbRadio
- // -------------------------------------------------------------------------
- class VfbRadio : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbRadio);
- VfbRadio() {};
-
- public:
- BOOL m_bVertical;
- // Implementation
- public:
- virtual int IsA() { return VCTL_RADIOLIST; }
- virtual void Serialize(CArchive& ar);
- };
-
-
- // -------------------------------------------------------------------------
- // VfbDropDown
- // -------------------------------------------------------------------------
- class VfbDropDown : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbDropDown);
- VfbDropDown() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_DROPDOWN; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbPicture
- // -------------------------------------------------------------------------
- class VfbPicture : public VfbCtl
- {
- public:
- CString m_bmpFile; // Bitmap file name
- int m_nImageWidth; // Width of each image in bmp
- // - use 0 (dflt) for 1 image
- DECLARE_SERIAL(VfbPicture);
- VfbPicture() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_PICTURE; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbPictButton
- // -------------------------------------------------------------------------
- class VfbPictButton : public VfbCtl
- {
- public:
- CString m_bmpFile; // Bitmap file name
- int m_nImageWidth; // Width of each image in bmp
- // - use 0 (dflt) for 1 image
- DECLARE_SERIAL(VfbPictButton);
- VfbPictButton() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_PICTBUTTON; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbPictCycle
- // -------------------------------------------------------------------------
- class VfbPictCycle : public VfbCtl
- {
- public:
- CString m_bmpFile; // Bitmap file name
- int m_nImageWidth; // Width of each image in bmp
- // - use 0 (dflt) for 1 image
- DECLARE_SERIAL(VfbPictCycle);
- VfbPictCycle() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_PICTCYCLE; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbRectangle
- // -------------------------------------------------------------------------
- class VfbRectangle : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbRectangle);
- VfbRectangle() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_RECTANGLE; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbLine
- // -------------------------------------------------------------------------
- class VfbLine : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbLine);
- VfbLine() {};
-
- public:
- BOOL m_bVertical;
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_LINE; }
- virtual void Serialize(CArchive& ar);
- };
-
- // -------------------------------------------------------------------------
- // VfbEllipse
- // -------------------------------------------------------------------------
- class VfbEllipse : public VfbCtl
- {
- protected:
- DECLARE_SERIAL(VfbEllipse);
- VfbEllipse() {};
-
- // Implementation
- public:
- virtual int IsA() { return VCTL_ELLIPSE; }
- virtual void Serialize(CArchive& ar);
- };
-
-
- // -------------------------------------------------------------------------
- // CVfbSection
- // -------------------------------------------------------------------------
- class CVfbSection
- {
- protected:
- VfbCtlList m_ctls; // List of controls in this section
- CString m_section; // Section name
- int m_nHdrHeight; // Height of section header
- int m_nHeight; // Height of the section
- int m_nBackStyle; // Background style of section
- VColor m_vclrBack; // Background Color of section
- CString m_bmpFile; // Bitmap File Name
-
- public:
- CVfbSection() {};
- ~CVfbSection();
-
- virtual void Serialize(CArchive& ar);
- VfbCtlList* CtlList() { return &m_ctls; }
- CString Section() { return m_section; }
- void Section(LPCTSTR szSection) { m_section = szSection; }
-
- int HdrHeight() { return m_nHdrHeight; }
- int Height() { return m_nHeight; }
- int BackStyle() { return m_nBackStyle; }
- VColor& BackVColor() { return m_vclrBack; }
- CString BmpFile() { return m_bmpFile; }
-
- int GetCtlCount() { return m_ctls.GetCount(); }
- };
-
-
- // -------------------------------------------------------------------------
- // CVfBldrDoc
- // -------------------------------------------------------------------------
- class CVfBldrDoc : public CDocument
- {
- public:
- CVfBldrDoc() {};
- virtual void Serialize(CArchive& ar);
-
- // protected:
- public:
- VfbCtlList m_ctls; // All controls
-
- CString m_version;
-
- // ----- Options -----
- int m_nGridX; // Grid X units
- int m_nGridY; // Grid Y units
- BOOL m_bShowGrid; // Show the Grid
- BOOL m_bSnapToGrid; // Snap to the grid
- VColor m_vclrGrid; // Design grid color
- CString m_workingDir; // Working directory
- CString m_dataReference;// Database, file, etc. reference
- CString m_dataSource; // Table, SQL, file, etc.
-
- // ----- Form / Grid Attributes -----
- int m_nMode; // Form, Grid, Report
- int m_nWidth; // width of form
- BOOL m_bReadOnly; // Read Only
- BOOL m_bAllowAdd; // Allow auto add of rows
- BOOL m_bSnapResize; // Snap resizing of rows
- BOOL m_bResizeRows; // Resizable rows
- BOOL m_bLiveAdjust; // Selector Tabs
- BOOL m_bSelectors; // Selector Tabs
- BOOL m_bScrollTips; // Scrolling tool tips
- BOOL m_bDropSource; // Drag Drop Source
- BOOL m_bDropTarget; // Drag Drop Target
-
- CString m_gridSettings; // Column order/widths
- int m_nGridStyle; // Grid style
- int m_nGridRowHeight; // Grid Row Height
- BOOL m_bResizeCols; // Resizable Columns
- BOOL m_bMoveableCols; // Moveable Columns
- int m_nFrozenCols; // Frozen Columns
- BOOL m_bGridHdrContextMenu; // TRUE if using menu
- VColor m_vclrGridLine; // Grid Line Color
- VColor m_vclrGridBack; // Grid Back Color
- VColor m_vclrGridText; // Grid Text Color
- VColor m_vclrHidden; // Hidden Color
- CString m_font; // Font
- int m_nFontSize; // Font Size
- BOOL m_bFontBold; // Bold Font
- BOOL m_bFontItalic; // Italic Font
- BOOL m_bFontUnderline; // Underline Font
-
- CVfbSection m_sectHdr;
- CVfbSection m_sectDtl;
- CVfbSection m_sectFtr;
-
- // Attributes
- public:
- VfbCtlList* GetCtls() { return &m_ctls; }
-
- // -------- Getting Properties --------
- int Width() { return m_nWidth; }
- int GridX() { return m_nGridX; }
- int GridY() { return m_nGridY; }
- BOOL ShowGrid() { return m_bShowGrid; }
- BOOL SnapToGrid() { return m_bSnapToGrid; }
- COLORREF GridColor() { return m_vclrGrid.GetRGB(); }
- CString GridSettings() { return m_gridSettings; }
- int GridStyle() { return m_nGridStyle; }
-
- BOOL DropSource() { return m_bDropSource; }
-
- CVfbSection* HdrSection() { return &m_sectHdr; }
- CVfbSection* DtlSection() { return &m_sectDtl; }
- CVfbSection* FtrSection() { return &m_sectFtr; }
-
- protected:
- friend class VForm;
- };
-
- #endif // __VFBLOAD_H__
-