Click here to Skip to main content
15,885,981 members
Articles / Desktop Programming / MFC

Creating Alternate GUI using Vector Art

Rate me:
Please Sign up or sign in to vote.
5.00/5 (22 votes)
6 Feb 2000 240.5K   7.3K   126  
Create visually complex, yet programmatically simple, non-rectangular GUIs
#ifndef _ARTCODE_H_
#define _ARTCODE_H_
typedef struct
{
     char         name[64];
     RECT         bounds;
     COLORREF     color;
     int          polyFillMode;
     int          count;
     POINT*       points;

}PolygonEntry;
typedef struct
{
     char         name[64];
     RECT         bounds;
     COLORREF     color;
     int          polyFillMode;
     int          count;
     POINT*       points;
     int          polyCount;
     int*         polys;

}PolyPolygonEntry;
typedef struct
{
     char         name[64];
     RECT         bounds;
     COLORREF     color;
     int          count;
     POINT*       points;

}PolyLineEntry;
typedef struct
{
     TCHAR        name[64];
     LOGFONT      font;
     COLORREF     bkColor;
     DWORD        bkMode;
     COLORREF     textColor;
     DWORD        textAlign;
     POINT        pos;
     TCHAR        text[128];

}TextEntry;
void Draw(CDC* pDC, PolygonEntry& entry, const CRect& clientRect, const CRect& bounds);
BOOL HitTest(PolygonEntry& entry, const CRect& clientRect, const CRect& bounds, const CPoint& point);
void Draw(CDC* pDC, PolyPolygonEntry& entry, const CRect& clientRect, const CRect& bounds);
BOOL HitTest(PolyPolygonEntry& entry, const CRect& clientRect, const CRect& bounds, const CPoint& point);
void Draw(CDC* pDC, PolyLineEntry& entry, const CRect& clientRect, const CRect& bounds);
BOOL HitTest(PolyLineEntry& entry, const CRect& clientRect, const CRect& bounds, const CPoint& point);
void Draw(CDC* pDC, TextEntry& entry, const CRect& clientRect, const CRect& bounds);
BOOL HitTest(TextEntry& entry, const CRect& clientRect, const CRect& bounds, const CPoint& point);
void CreateRegion(CRgn& rgn, PolygonEntry& entry, const CRect& clientRect, const CRect& bounds);
void CreateRegion(CRgn& rgn, PolyPolygonEntry& entry, const CRect& clientRect, const CRect& bounds);
void CreateRegion(CRgn& rgn, PolyLineEntry& entry, const CRect& clientRect, const CRect& bounds);
#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Software Developer (Senior)
United States United States
I work at Tektronix in Beaverton OR. I've been programming for fun since 1975 (I started while in a Computer Explorer Scout group in Spokane WA). I've been programming in C since 1979 and I've been working professionally since 1983.

I really enjoy www.codeproject.com. It has saved me an incredible amount of time. I only hope my small contributions have given back some of what I've taken.

Comments and Discussions