diff options
author | Rr42 | 2018-06-26 14:58:14 +0530 |
---|---|---|
committer | Rr42 | 2018-06-26 14:58:14 +0530 |
commit | 9673954adfd5a563072e085df5e09d427557466b (patch) | |
tree | e83ee518b6c23a37d5668fbcfb401b838bb21b59 /ldmicro/lib/linuxUI | |
parent | f0d0df7fb0658b315f79748e713aa4103c4b335e (diff) | |
download | LDMicroGtk-9673954adfd5a563072e085df5e09d427557466b.tar.gz LDMicroGtk-9673954adfd5a563072e085df5e09d427557466b.tar.bz2 LDMicroGtk-9673954adfd5a563072e085df5e09d427557466b.zip |
Added "export as text" functionality.
Diffstat (limited to 'ldmicro/lib/linuxUI')
-rw-r--r-- | ldmicro/lib/linuxUI/linuxUI.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp index e65c7d5..0d08de5 100644 --- a/ldmicro/lib/linuxUI/linuxUI.cpp +++ b/ldmicro/lib/linuxUI/linuxUI.cpp @@ -282,6 +282,9 @@ HANDLE GetStockObject(int fnObject) void SelectObject(HCRDC hcr, HFONT hfont) { + if (hcr ==NULL) + return; + cairo_select_font_face(hcr, hfont->lpszFace, hfont->fdwItalic ? CAIRO_FONT_SLANT_ITALIC : CAIRO_FONT_SLANT_NORMAL, hfont->fnWeight == FW_BOLD ? CAIRO_FONT_WEIGHT_BOLD : CAIRO_FONT_WEIGHT_NORMAL); @@ -326,6 +329,9 @@ HFONT CreateFont(int nHeight, int nWidth, int nOrientation, int fnWeight, void SetBkColor(HWID widget, HCRDC hcr, COLORREF bkCol) { + if (hcr == NULL) + return; + gtk_widget_override_background_color(GTK_WIDGET(widget), GTK_STATE_FLAG_NORMAL, &bkCol); @@ -349,12 +355,18 @@ void SetBkColor(HWID widget, HCRDC hcr, COLORREF bkCol) void SetTextColor(HCRDC hcr, COLORREF color) { + if (hcr == NULL) + return; + HdcCurrentTextColor = color; gdk_cairo_set_source_rgba (hcr, &color); } void TextOut(HWID hWid, HCRDC hcr, int nXStart, int nYStart, LPCTSTR lpString, int cchString) { + if (hcr == NULL) + return; + nYStart += 30; cairo_text_extents_t extents; @@ -419,6 +431,9 @@ BOOL InvalidateRect(HWID hWid, const RECT *lpRect, BOOL bErase) int FillRect(HCRDC hDC, const RECT *lprc, HBRUSH hbr) { + if (hDC == NULL) + return -1; + GDRECT gdrc; RECT_to_GDRECT(lprc, &gdrc); @@ -432,6 +447,9 @@ int FillRect(HCRDC hDC, const RECT *lprc, HBRUSH hbr) BOOL PatBlt(HCRDC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD dwRop, HBRUSH hbr) { + if (hdc == NULL) + return FALSE; + cairo_set_source_rgb(hdc, hbr->red, hbr->green, hbr->blue); cairo_rectangle(hdc, nXLeft, nYLeft + 20, nWidth, nHeight); cairo_stroke_preserve(hdc); |