diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2016-04-17 14:22:02 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2016-04-17 14:22:02 +0000 |
| commit | cc57af841a11ee314efca6a434ff14bed51706e4 (patch) | |
| tree | f3080908a464e23d2c24c3643a049afc4f449708 /src/drivers/GDI | |
| parent | a4e5dc0267bf972b5897aec0f167b3e2d9488a8c (diff) | |
virtualizes fl_set_spot and fl_reset_spot
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11640 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 5 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx | 28 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 4d4a50bd1..bbda02bc2 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -127,8 +127,11 @@ protected: void color(Fl_Color c); Fl_Color color() { return color_; } void color(uchar r, uchar g, uchar b); + void set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win); + void reset_spot(); }; + /** The graphics driver used when printing on MSWindows. * @@ -142,6 +145,7 @@ public: int draw_scaled(Fl_Image *img, int XP, int YP, int WP, int HP); }; + class Fl_Translated_GDI_Graphics_Driver : public Fl_GDI_Graphics_Driver { unsigned depth; POINT origins[10]; @@ -151,6 +155,7 @@ public: virtual void untranslate_all(void); }; + #endif // FL_GDI_GRAPHICS_DRIVER_H // diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index 7da208573..817c7e154 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx @@ -179,6 +179,34 @@ void Fl_Graphics_Driver::XDestroyRegion(Fl_Region r) { } +void Fl_Graphics_Driver::reset_spot() +{ +} + +void Fl_Graphics_Driver::set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win) +{ + if (!win) return; + Fl_Window* tw = win; + while (tw->parent()) tw = tw->window(); // find top level window + + if (!tw->shown()) + return; + + HIMC himc = flImmGetContext(fl_xid(tw)); + + if (himc) { + COMPOSITIONFORM cfs; + cfs.dwStyle = CFS_POINT; + cfs.ptCurrentPos.x = X; + cfs.ptCurrentPos.y = Y - tw->labelsize(); + MapWindowPoints(fl_xid(win), fl_xid(tw), &cfs.ptCurrentPos, 1); + flImmSetCompositionWindow(himc, &cfs); + flImmReleaseContext(fl_xid(tw), himc); + } +} + + + // // End of "$Id$". // |
