|
SavvyUI C++ UI Library
|
#include <Graphics.h>
Public Member Functions | |
| Graphics (WinHandle hWnd, DCHandle hDC) | |
| virtual | ~Graphics () |
| DCHandle | getHDC () |
| COLORREF | setTextColor (COLORREF newColor) |
| COLORREF | getTextColor () |
| COLORREF | setBackgroundColor (COLORREF newColor) |
| COLORREF | getBackgroundColor () |
| int | setBackgroundMode (int bkMode) |
| int | getTextHeight (int defaultHeight) |
| Calculates the height of text for a given window. | |
| int | getTextWidth (const wstring &text) |
| Calculates the width of the specified text for a given window. | |
| void | setPen (int width, COLORREF color) |
| void | restorePen () |
| void | setFont (const wstring &fontName, int fontSize, BOOL isBold=FALSE, BOOL isItalic=FALSE, BOOL isUnderlined=FALSE) |
| void | restoreFont () |
| void | drawLine (long x1, long y1, long x2, long y2, COLORREF color=Theme::LineColor) |
| Draws a line on the device context. | |
| void | drawBorder (Bounds rect, COLORREF color=Theme::LineColor) |
| Draws a border around the specified rectangle. | |
| void | drawRaisedBorder (Bounds rect) |
| Draws a raised (3D) border around the rectangle. | |
| void | drawSunkenBorder (Bounds rect) |
| Draws a sunken (3D) border around the rectangle. | |
| void | drawButton (Bounds rect, const wstring &text, const ButtonType &btnType=ButtonType::DEFAULT, BOOL isPressed=FALSE, BOOL isDisabled=FALSE, const IconSource &iconSource=IconSource(), const Direction &iconPosition=Direction::LEFT, BOOL isRounded=FALSE, BOOL hasShadow=TRUE, BOOL hasBorder=TRUE, BOOL isGradient=FALSE, COLORREF bkColor=Theme::ButtonBackgroundStartColor, COLORREF fgColor=Theme::ButtonForegroundColor) |
| Draws a button with the specified text and style. | |
| void | fillGradient (Bounds rect, COLORREF bkStartColor, COLORREF bkEndColor) |
| Fills a rectangle with a vertical gradient. | |
| void | fillRect (Bounds rect, COLORREF color) |
| Fills a rectangle with the specified color. | |
| void | drawText (Bounds rect, const wstring &text, int alignment, BOOL bold=FALSE, BOOL italic=FALSE, BOOL underlined=FALSE) |
| Draws text within the specified rectangle with formatting. | |
| void | paintHeader (Bounds rect, const wstring &text) |
| Paints a header area with text. | |
| void | paintCheckBox (Bounds rect, BOOL checked) |
| Paints a checkbox. | |
| void | paintRadioButton (Bounds rect, BOOL checked) |
| Paints a radio button. | |
| void | paintSortIndicator (Bounds rect, const SortType &sortDirection, COLORREF color) |
| Paints a sort direction indicator. | |
| void | polygon (const POINT *pts, int ptCount, COLORREF fillColor=Theme::BackgroundColor) |
| void | ellipse (Bounds rect, COLORREF fillColor=Theme::BackgroundColor) |
| void | rectangle (Bounds rect, COLORREF fillColor=Theme::BackgroundColor) |
| void | roundRect (Bounds rect, int xRadius, int yRadius, COLORREF bkColor=Theme::BackgroundColor, COLORREF color=Theme::LineColor) |
| void | setClipRegion (int x1, int y1, int x2, int y2) |
| void | clearClipRegion () |
| void | drawDownArrow (Bounds rect, COLORREF color=Theme::ForegroundColor) |
| void | drawUpArrow (Bounds rect, COLORREF color=Theme::ForegroundColor) |
| void | drawLeftArrow (Bounds rect, COLORREF color=Theme::ForegroundColor) |
| void | drawRightArrow (Bounds rect, COLORREF color=Theme::ForegroundColor) |
| void | drawCheckMark (Bounds rect, COLORREF color=Theme::ForegroundColor) |
|
virtual |
| void Graphics::clearClipRegion | ( | ) |
| void Graphics::drawBorder | ( | Bounds | rect, |
| COLORREF | color = Theme::LineColor ) |
Draws a border around the specified rectangle.
| rect | Rectangle area. |
| color | Border color (default is Theme::LineColor). |
| void Graphics::drawButton | ( | Bounds | rect, |
| const wstring & | text, | ||
| const ButtonType & | btnType = ButtonType::DEFAULT, | ||
| BOOL | isPressed = FALSE, | ||
| BOOL | isDisabled = FALSE, | ||
| const IconSource & | iconSource = IconSource(), | ||
| const Direction & | iconPosition = Direction::LEFT, | ||
| BOOL | isRounded = FALSE, | ||
| BOOL | hasShadow = TRUE, | ||
| BOOL | hasBorder = TRUE, | ||
| BOOL | isGradient = FALSE, | ||
| COLORREF | bkColor = Theme::ButtonBackgroundStartColor, | ||
| COLORREF | fgColor = Theme::ButtonForegroundColor ) |
Draws a button with the specified text and style.
| rect | Rectangle area of the button. |
| text | Button label text. |
| btnType | Button style/type (e.g., L"primary"|L"default"|L"danger"|L"success"). |
| isPressed | Button pressed state. |
| isDisabled | Button disabled state. |
| iconFile | Icon File Path - Optional (e.g., L"images/filename.png"). |
| iconPosition | Icon orientation (e.g., L"left"|L"top"|L"bottom"|L"right"). |
| isRounded | Button rounded border state. |
| hasShadow | Button shadow state. |
| isGradient | Button gradient paint. |
| void Graphics::drawCheckMark | ( | Bounds | rect, |
| COLORREF | color = Theme::ForegroundColor ) |
| void Graphics::drawDownArrow | ( | Bounds | rect, |
| COLORREF | color = Theme::ForegroundColor ) |
| void Graphics::drawLeftArrow | ( | Bounds | rect, |
| COLORREF | color = Theme::ForegroundColor ) |
| void Graphics::drawLine | ( | long | x1, |
| long | y1, | ||
| long | x2, | ||
| long | y2, | ||
| COLORREF | color = Theme::LineColor ) |
Draws a line on the device context.
| x1 | Starting X coordinate. |
| y1 | Starting Y coordinate. |
| x2 | Ending X coordinate. |
| y2 | Ending Y coordinate. |
| color | Line color (default is Theme::LineColor). |
| void Graphics::drawRaisedBorder | ( | Bounds | rect | ) |
Draws a raised (3D) border around the rectangle.
| rect | Rectangle area. |
| void Graphics::drawRightArrow | ( | Bounds | rect, |
| COLORREF | color = Theme::ForegroundColor ) |
| void Graphics::drawSunkenBorder | ( | Bounds | rect | ) |
Draws a sunken (3D) border around the rectangle.
| rect | Rectangle area. |
| void Graphics::drawText | ( | Bounds | rect, |
| const wstring & | text, | ||
| int | alignment, | ||
| BOOL | bold = FALSE, | ||
| BOOL | italic = FALSE, | ||
| BOOL | underlined = FALSE ) |
Draws text within the specified rectangle with formatting.
| rect | Rectangle area. |
| text | Text to draw. |
| alignment | Text alignment (-1 = left, 0 = center, 1 = right). |
| bold | Whether the text is bold. |
| italic | Whether the text is italic. |
| underlined | Whether the text is underlined. |
| void Graphics::drawUpArrow | ( | Bounds | rect, |
| COLORREF | color = Theme::ForegroundColor ) |
| void Graphics::ellipse | ( | Bounds | rect, |
| COLORREF | fillColor = Theme::BackgroundColor ) |
| void Graphics::fillGradient | ( | Bounds | rect, |
| COLORREF | bkStartColor, | ||
| COLORREF | bkEndColor ) |
Fills a rectangle with a vertical gradient.
| rect | Rectangle area to fill. |
| bkStartColor | Starting color of the gradient. |
| bkEndColor | Ending color of the gradient. |
| void Graphics::fillRect | ( | Bounds | rect, |
| COLORREF | color ) |
Fills a rectangle with the specified color.
| rect | Rectangle area to fill. |
| color | fill color. |
| COLORREF Graphics::getBackgroundColor | ( | ) |
| DCHandle Graphics::getHDC | ( | ) |
| COLORREF Graphics::getTextColor | ( | ) |
| int Graphics::getTextHeight | ( | int | defaultHeight | ) |
Calculates the height of text for a given window.
| defaultHeight | Default height if calculation fails. |
| int Graphics::getTextWidth | ( | const wstring & | text | ) |
Calculates the width of the specified text for a given window.
| text | Text string to measure. |
| void Graphics::paintCheckBox | ( | Bounds | rect, |
| BOOL | checked ) |
Paints a checkbox.
| rect | Rectangle area of the checkbox. |
| checked | The checked state. |
| void Graphics::paintHeader | ( | Bounds | rect, |
| const wstring & | text ) |
Paints a header area with text.
| rect | Rectangle area of the header. |
| text | Header text. |
| void Graphics::paintRadioButton | ( | Bounds | rect, |
| BOOL | checked ) |
Paints a radio button.
| rect | Rectangle area of the radio button. |
| checked | The checked state. |
Paints a sort direction indicator.
| rect | Rectangle area of the sort indicator. |
| sortDirection | The direction of the sort. |
| void Graphics::polygon | ( | const POINT * | pts, |
| int | ptCount, | ||
| COLORREF | fillColor = Theme::BackgroundColor ) |
| void Graphics::rectangle | ( | Bounds | rect, |
| COLORREF | fillColor = Theme::BackgroundColor ) |
| void Graphics::restoreFont | ( | ) |
| void Graphics::restorePen | ( | ) |
| void Graphics::roundRect | ( | Bounds | rect, |
| int | xRadius, | ||
| int | yRadius, | ||
| COLORREF | bkColor = Theme::BackgroundColor, | ||
| COLORREF | color = Theme::LineColor ) |
| COLORREF Graphics::setBackgroundColor | ( | COLORREF | newColor | ) |
| int Graphics::setBackgroundMode | ( | int | bkMode | ) |
| void Graphics::setClipRegion | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2 ) |
| void Graphics::setFont | ( | const wstring & | fontName, |
| int | fontSize, | ||
| BOOL | isBold = FALSE, | ||
| BOOL | isItalic = FALSE, | ||
| BOOL | isUnderlined = FALSE ) |
| void Graphics::setPen | ( | int | width, |
| COLORREF | color ) |
| COLORREF Graphics::setTextColor | ( | COLORREF | newColor | ) |