diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-03 15:27:40 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-03 15:27:40 +0000 |
commit | 148215506db4a47326caf083d90ffed788583061 (patch) | |
tree | 2a6cf811d1e1c86821e0cd284c056bb2e7f531f7 /nuttx/graphics | |
parent | 37b3d65d15fa5e041a5cdb03d404505ae293e38e (diff) | |
download | px4-nuttx-148215506db4a47326caf083d90ffed788583061.tar.gz px4-nuttx-148215506db4a47326caf083d90ffed788583061.tar.bz2 px4-nuttx-148215506db4a47326caf083d90ffed788583061.zip |
Modify examples/nx to use NXTK; fix related bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1407 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/graphics')
-rw-r--r-- | nuttx/graphics/nxmu/nxmu_openwindow.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_drawframe.c | 25 |
2 files changed, 24 insertions, 3 deletions
diff --git a/nuttx/graphics/nxmu/nxmu_openwindow.c b/nuttx/graphics/nxmu/nxmu_openwindow.c index a458bc676..706d00a2d 100644 --- a/nuttx/graphics/nxmu/nxmu_openwindow.c +++ b/nuttx/graphics/nxmu/nxmu_openwindow.c @@ -104,7 +104,7 @@ void nxmu_openwindow(FAR struct nxbe_state_s *be, FAR struct nxbe_window_s *wnd) /* Report the initial size/position of the window to the client */ - nxfe_reportposition((NXWINDOW)wnd); + nxfe_reportposition(wnd); /* Provide the initial mouse settings to the client */ diff --git a/nuttx/graphics/nxtk/nxtk_drawframe.c b/nuttx/graphics/nxtk/nxtk_drawframe.c index 0b8a73361..9fb85fc56 100644 --- a/nuttx/graphics/nxtk/nxtk_drawframe.c +++ b/nuttx/graphics/nxtk/nxtk_drawframe.c @@ -187,7 +187,11 @@ int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd, nxtk_drawframeside(fwnd, &frame, bounds, g_bordercolor2); #endif - /* Draw the inner left side, Thickness: 1, Color: CONFIG_NXTK_BORDERCOLOR2 */ + /* Draw the inner left side, Thickness: 1, Color: CONFIG_NXTK_BORDERCOLOR2. + * This segment stops at the bottom of the toolbar. If there is a + * tool bar, then we have to continue this to the top of the display + * using g_bordercolor1 (see below) + */ #if CONFIG_NXTK_BORDERWIDTH > 1 frame.pt1.y = CONFIG_NXTK_BORDERWIDTH - 1 + tbsize.h; @@ -203,7 +207,7 @@ int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd, /* Draw the inner left side, Thickness: CONFIG_NXTK_BORDERWIDTH-1, * Color: CONFIG_NXTK_BORDERCOLOR1 - */ + */ #if CONFIG_NXTK_BORDERWIDTH > 1 frame.pt1.x = wndsize.w - CONFIG_NXTK_BORDERWIDTH; @@ -213,5 +217,22 @@ int nxtk_drawframe(FAR struct nxtk_framedwindow_s *fwnd, frame.pt2.x = frame.pt1.x; #endif nxtk_drawframeside(fwnd, &frame, bounds, g_bordercolor1); + + /* When there is a toolbar, we also have to patch in this tiny + * line segment -- Is there a better way? + */ + +#if CONFIG_NXTK_BORDERWIDTH > 1 + if (tbsize.h > 0) + { + frame.pt1.y = 0; + frame.pt2.y = CONFIG_NXTK_BORDERWIDTH + tbsize.h; + + frame.pt1.x = CONFIG_NXTK_BORDERWIDTH - 1; + frame.pt2.x = frame.pt1.x; + nxtk_drawframeside(fwnd, &frame, bounds, g_bordercolor1); + } +#endif + return OK; } |