mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
remove background from pts display in tray; center arrow; fix draw
during multiple hints.
This commit is contained in:
parent
ce29cdb1b3
commit
ceb34e32c0
1 changed files with 12 additions and 61 deletions
|
@ -84,7 +84,7 @@ makeAndDrawBitmap( CEDrawCtx* dctx, HDC hdc, XP_U32 x, XP_U32 y,
|
||||||
SelectObject( hdc, oldObj );
|
SelectObject( hdc, oldObj );
|
||||||
DeleteObject( forePen );
|
DeleteObject( forePen );
|
||||||
#else
|
#else
|
||||||
/* I can't get this to work.... */
|
/* I can't get this to work. Hence the above hack.... */
|
||||||
HBITMAP bm;
|
HBITMAP bm;
|
||||||
bm = CreateBitmap( info->nCols, info->nRows, 1, 1,
|
bm = CreateBitmap( info->nCols, info->nRows, 1, 1,
|
||||||
info->bits );
|
info->bits );
|
||||||
|
@ -94,41 +94,17 @@ makeAndDrawBitmap( CEDrawCtx* dctx, HDC hdc, XP_U32 x, XP_U32 y,
|
||||||
#endif
|
#endif
|
||||||
} /* makeAndDrawBitmap */
|
} /* makeAndDrawBitmap */
|
||||||
|
|
||||||
#if 0
|
static XP_Bool
|
||||||
static void
|
|
||||||
drawBitmapAt( HDC hdc, CEBitmapInfo* bmp, RECT* rt )
|
|
||||||
{
|
|
||||||
HDC tmpHDC;
|
|
||||||
HBITMAP bitmap = bmp->bitmap;
|
|
||||||
RECT r = *rt;
|
|
||||||
HBRUSH brush;
|
|
||||||
HBRUSH oldBrush;
|
|
||||||
|
|
||||||
tmpHDC = CreateCompatibleDC( hdc );
|
|
||||||
SelectObject( tmpHDC, bitmap );
|
|
||||||
|
|
||||||
r.bottom = r.top + bmp->nRows;
|
|
||||||
r.right = r.left + bmp->nCols;
|
|
||||||
|
|
||||||
BitBlt
|
|
||||||
|
|
||||||
/* brush = CreatePatternBrush( bitmap ); */
|
|
||||||
/* oldBrush = SelectObject( hdc, brush ); */
|
|
||||||
Rectangle( hdc, r.left, r.top, r.right, r.bottom );
|
|
||||||
/* FillRect( hdc, &r, brush ); */
|
|
||||||
/* SelectObject( hdc, oldBrush ); */
|
|
||||||
/* DeleteObject( brush ); */
|
|
||||||
} /* drawBitmapAt */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
|
||||||
ce_draw_boardBegin( DrawCtx* p_dctx, XP_Rect* rect, XP_Bool hasfocus )
|
ce_draw_boardBegin( DrawCtx* p_dctx, XP_Rect* rect, XP_Bool hasfocus )
|
||||||
{
|
{
|
||||||
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
||||||
CEAppGlobals* globals = dctx->globals;
|
CEAppGlobals* globals = dctx->globals;
|
||||||
HDC hdc = globals->hdc;
|
HDC hdc = globals->hdc;
|
||||||
|
XP_Bool canDraw = !!hdc;
|
||||||
dctx->prevBkColor = GetBkColor( hdc );
|
if ( canDraw ) {
|
||||||
|
dctx->prevBkColor = GetBkColor( hdc );
|
||||||
|
}
|
||||||
|
return canDraw;
|
||||||
} /* draw_boardBegin */
|
} /* draw_boardBegin */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -165,6 +141,8 @@ ce_draw_drawCell( DrawCtx* p_dctx, XP_Rect* xprect,
|
||||||
XP_UCHAR* cp = NULL;
|
XP_UCHAR* cp = NULL;
|
||||||
COLORREF foreIndex;
|
COLORREF foreIndex;
|
||||||
|
|
||||||
|
XP_ASSERT( !!hdc );
|
||||||
|
|
||||||
XPRtoRECT( &rt, xprect );
|
XPRtoRECT( &rt, xprect );
|
||||||
++rt.bottom;
|
++rt.bottom;
|
||||||
++rt.right;
|
++rt.right;
|
||||||
|
@ -243,34 +221,6 @@ ce_draw_trayBegin( DrawCtx* p_dctx, XP_Rect* rect, XP_U16 owner,
|
||||||
XP_Bool hasfocus )
|
XP_Bool hasfocus )
|
||||||
{
|
{
|
||||||
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
|
||||||
#if 0
|
|
||||||
int icrResult;
|
|
||||||
CEAppGlobals* globals = dctx->globals;
|
|
||||||
HDC hdc = globals->hdc;
|
|
||||||
RECT cr;
|
|
||||||
HRGN hrgn;
|
|
||||||
|
|
||||||
XPRtoRECT( &cr, rect );
|
|
||||||
|
|
||||||
hrgn = CreateRectRgn( cr.left, cr.top, cr.right, cr.bottom );
|
|
||||||
if ( !hrgn ) {
|
|
||||||
logLastError("CreateRectRgn");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* int GetClipRgn( hdc, hrgn ); */
|
|
||||||
|
|
||||||
|
|
||||||
/* if ( !SetRectRgn( hrgn, cr.left, cr.top, cr.right, cr.bottom ) ) { */
|
|
||||||
/* logLastError(); */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
icrResult = SelectClipRgn( hdc, NULL );
|
|
||||||
XP_LOGF( "SelectClipRgn(NULL)=>%s", logClipResult(icrResult) );
|
|
||||||
|
|
||||||
icrResult = SelectClipRgn( hdc, hrgn );
|
|
||||||
logLastError("SelectClipRgn");
|
|
||||||
XP_LOGF( "SelectClipRgn(hrgn)=>%s", logClipResult(icrResult) );
|
|
||||||
#endif
|
|
||||||
dctx->trayOwner = owner;
|
dctx->trayOwner = owner;
|
||||||
} /* ce_draw_trayBegin */
|
} /* ce_draw_trayBegin */
|
||||||
|
|
||||||
|
@ -433,7 +383,7 @@ ce_draw_drawBoardArrow( DrawCtx* p_dctx, XP_Rect* xprect,
|
||||||
SetBkColor( hdc, dctx->colors[bkIndex] );
|
SetBkColor( hdc, dctx->colors[bkIndex] );
|
||||||
SetTextColor( hdc, dctx->colors[BLACK_COLOR] );
|
SetTextColor( hdc, dctx->colors[BLACK_COLOR] );
|
||||||
|
|
||||||
ceDrawBitmapInRect( hdc, rt.left+1, rt.top+1, cursor );
|
ceDrawBitmapInRect( hdc, rt.left+2, rt.top+1, cursor );
|
||||||
|
|
||||||
} /* ce_draw_drawBoardArrow */
|
} /* ce_draw_drawBoardArrow */
|
||||||
|
|
||||||
|
@ -598,6 +548,7 @@ ce_draw_score_pendingScore( DrawCtx* p_dctx, XP_Rect* rect, XP_S16 score,
|
||||||
RECT rt;
|
RECT rt;
|
||||||
|
|
||||||
SetTextColor( hdc, dctx->colors[BLACK_COLOR] );
|
SetTextColor( hdc, dctx->colors[BLACK_COLOR] );
|
||||||
|
SetBkColor( hdc, dctx->colors[BKG_COLOR] );
|
||||||
|
|
||||||
XPRtoRECT( &rt, rect );
|
XPRtoRECT( &rt, rect );
|
||||||
FillRect( hdc, &rt, dctx->brushes[BKG_COLOR] );
|
FillRect( hdc, &rt, dctx->brushes[BKG_COLOR] );
|
||||||
|
@ -717,7 +668,7 @@ ce_draw_drawMiniWindow( DrawCtx* p_dctx, XP_UCHAR* text, XP_Rect* rect,
|
||||||
|
|
||||||
XPRtoRECT( &rt, rect );
|
XPRtoRECT( &rt, rect );
|
||||||
|
|
||||||
if ( globals->hdc ) {
|
if ( !!globals->hdc ) {
|
||||||
hdc = globals->hdc;
|
hdc = globals->hdc;
|
||||||
} else {
|
} else {
|
||||||
InvalidateRect( dctx->mainWin, &rt, FALSE );
|
InvalidateRect( dctx->mainWin, &rt, FALSE );
|
||||||
|
|
Loading…
Reference in a new issue