Home |
HMI (Human-Machine Interface) Classes Class PegCircularBitmapDial |
Class PegCircularBitmapDialPegCircularBitmapDial behaves exactly the same as PegCircularDial, from which it derives. The differences are the user may specify a background bitmap over which the dial needle will be drawn as well as a bitmap that will be used to draw the needle anchor at the center of rotation. This allows for very custom looking finite dials. An added feature of PegCircularBitmapDial is the ability to specify a center of rotation that is not necessarily the center of the bounding rectangle for the dial. Typically, the needle of the dial would originate at the center of the bounding rectangle. PegCircularBitmapDial allows for the needle to originate from anywhere inside its bounding rectangle. This further adds to the custom possibilities when designing dials. class PegCircularBitmapDial : public PegCircularDial { public: PegCircularBitmapDial(const PegRect& Rect, PEGINT iRefAngle, LONG lValuePerRev, LONG lMinValue, LONG lMaxValue, PegBitmap * pBkgBitmap, PegBitmap * pAnchorBitmap = NULL, PEGUINT wStyle = DS_STANDARDSTYLE); PegCircularBitmapDial(PEGINT iLeft, PEGINT iTop, PEGINT iRefAngle, LONG lValuePerRev, LONG lMinValue, LONG lMaxValue, PegBitmap * pBkgBitmap, PegBitmap * pAnchorBitmap = NULL, PEGUINT wStyle = DS_STANDARDSTYLE); virtual void Draw(); PegBitmap * GetBkgBitmap(void) const; void SetBkgBitmap(PegBitmap * pBmp); PegBitmap * GetAnchorBitmap(void) const; void SetAnchorBitmap(PegBitmap * pBmp); void UseTrueCOR(BOOL bUse); void SetCOR(PEGINT CORX, PEGINT CORY, BOOL bRedraw = FALSE); PEGINT GetCORX(void) const; PEGINT GetCORY(void) const; }; Style FlagsPegCircularBitmapDial supports the styles described in PegDial. PegCircularBitmapDial does not support any of the frame styles because it uses the background bitmap for drawing in the client area of the dial. SignalsPegCircularBitmapDial does not send any signals. ConstructorsThe first constructor takes a reference to a PegRect to determine its size, a PEGINT value for the reference angle, a LONG value for the value per revolution, a minimum and maximum value, a pointer to a bitmap that will be used for drawing the background, a pointer to a bitmap that will be used to draw the needle anchor, and a style PEGUINT. The seconds constructor takes PEGINT values to the left and top positions of the dial. If a background bitmap is specified, the object is sized to the height and width of the bitmap. The remaining parameters are the same as the above constructor. Method DrawPegCircularBitmapDial overrides the Draw() function to draw the background bitmap and needle. Method GetAnchorBitmapThis method returns a PegBitmap pointer to the anchor bitmap. Method GetBkgBitmapThis method returns a PegBitmap pointer to the background bitmap. Method GetCORXThis function returns the the x center of rotation. Method GetCORYThis function returns the y center of rotation. Method SetAnchorBitmapThis method set the anchor bitmap to point to pBmp. Method SetBkgBitmapThis method set the background bitmap to point to pBmp. Method SetCORThis allows for the setting of the x and y values of the center of rotation (the origin of the needle) of the dial. Method UseTrueCORThis method is short hand for setting the style flags DS_RECTCOR and DS_USERCOR to on or off, depending on the value of bUse.
|