mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
implement drawTileMidDrag (same as tile in tray for now)
This commit is contained in:
parent
da665d1bc9
commit
72ada6b1a8
1 changed files with 14 additions and 5 deletions
|
@ -276,6 +276,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
COLORREF foreColorRef;
|
COLORREF foreColorRef;
|
||||||
XP_Bool isPending = (flags & CELL_HIGHLIGHT) != 0;
|
XP_Bool isPending = (flags & CELL_HIGHLIGHT) != 0;
|
||||||
XP_Bool isFocussed = (flags & CELL_ISCURSOR) != 0;
|
XP_Bool isFocussed = (flags & CELL_ISCURSOR) != 0;
|
||||||
|
XP_Bool isDragSrc = (flags & CELL_DRAGSRC) != 0;
|
||||||
|
|
||||||
XP_ASSERT( !!hdc );
|
XP_ASSERT( !!hdc );
|
||||||
|
|
||||||
|
@ -292,7 +293,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
/* always init to silence compiler warning */
|
/* always init to silence compiler warning */
|
||||||
foreColorRef = dctx->globals->appPrefs.colors[getPlayerColor(owner)];
|
foreColorRef = dctx->globals->appPrefs.colors[getPlayerColor(owner)];
|
||||||
|
|
||||||
if ( (!!letters && letters[0] != '\0' ) || !!bitmap ) {
|
if ( !isDragSrc && ((!!letters && letters[0] != '\0' ) || !!bitmap )) {
|
||||||
if ( isPending ) {
|
if ( isPending ) {
|
||||||
bkIndex = CE_BLACK_COLOR;
|
bkIndex = CE_BLACK_COLOR;
|
||||||
foreColorRef = dctx->globals->appPrefs.colors[CE_WHITE_COLOR];
|
foreColorRef = dctx->globals->appPrefs.colors[CE_WHITE_COLOR];
|
||||||
|
@ -331,7 +332,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
|
|
||||||
SetBkColor( hdc, dctx->globals->appPrefs.colors[bkIndex] );
|
SetBkColor( hdc, dctx->globals->appPrefs.colors[bkIndex] );
|
||||||
|
|
||||||
if ( !!letters && (letters[0] != '\0') ) {
|
if ( !isDragSrc && !!letters && (letters[0] != '\0') ) {
|
||||||
wchar_t widebuf[4];
|
wchar_t widebuf[4];
|
||||||
cp = letters;
|
cp = letters;
|
||||||
|
|
||||||
|
@ -348,7 +349,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
DrawText( hdc, widebuf, -1, &textRect,
|
DrawText( hdc, widebuf, -1, &textRect,
|
||||||
DT_SINGLELINE | DT_VCENTER | DT_CENTER);
|
DT_SINGLELINE | DT_VCENTER | DT_CENTER);
|
||||||
|
|
||||||
} else if ( !!bitmap ) {
|
} else if ( !isDragSrc && !!bitmap ) {
|
||||||
makeAndDrawBitmap( dctx, hdc, &rt, XP_TRUE,
|
makeAndDrawBitmap( dctx, hdc, &rt, XP_TRUE,
|
||||||
foreColorRef, (CEBitmapInfo*)bitmap );
|
foreColorRef, (CEBitmapInfo*)bitmap );
|
||||||
} else if ( (flags&CELL_ISSTAR) != 0 ) {
|
} else if ( (flags&CELL_ISSTAR) != 0 ) {
|
||||||
|
@ -482,6 +483,16 @@ DRAW_FUNC_NAME(drawTile)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
drawDrawTileGuts( p_dctx, xprect, letters, bitmap, val, flags );
|
drawDrawTileGuts( p_dctx, xprect, letters, bitmap, val, flags );
|
||||||
} /* ce_draw_drawTile */
|
} /* ce_draw_drawTile */
|
||||||
|
|
||||||
|
#ifdef POINTER_SUPPORT
|
||||||
|
DLSTATIC void
|
||||||
|
DRAW_FUNC_NAME(drawTileMidDrag)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
|
const XP_UCHAR* letters, XP_Bitmap bitmap,
|
||||||
|
XP_S16 val, CellFlags flags )
|
||||||
|
{
|
||||||
|
drawDrawTileGuts( p_dctx, xprect, letters, bitmap, val, flags );
|
||||||
|
} /* ce_draw_drawTile */
|
||||||
|
#endif
|
||||||
|
|
||||||
DLSTATIC void
|
DLSTATIC void
|
||||||
DRAW_FUNC_NAME(drawTileBack)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
DRAW_FUNC_NAME(drawTileBack)( DrawCtx* p_dctx, const XP_Rect* xprect,
|
||||||
CellFlags flags )
|
CellFlags flags )
|
||||||
|
@ -1101,10 +1112,8 @@ ce_drawctxt_make( MPFORMAL HWND mainWin, CEAppGlobals* globals )
|
||||||
|
|
||||||
dctx->rightArrow = LoadBitmap( globals->hInst,
|
dctx->rightArrow = LoadBitmap( globals->hInst,
|
||||||
MAKEINTRESOURCE(IDB_RIGHTARROW) );
|
MAKEINTRESOURCE(IDB_RIGHTARROW) );
|
||||||
XP_DEBUGF( "loaded bitmap: 0x%lx", (unsigned long)dctx->rightArrow );
|
|
||||||
dctx->downArrow = LoadBitmap( globals->hInst,
|
dctx->downArrow = LoadBitmap( globals->hInst,
|
||||||
MAKEINTRESOURCE(IDB_DOWNARROW) );
|
MAKEINTRESOURCE(IDB_DOWNARROW) );
|
||||||
|
|
||||||
dctx->origin = LoadBitmap( globals->hInst,
|
dctx->origin = LoadBitmap( globals->hInst,
|
||||||
MAKEINTRESOURCE(IDB_ORIGIN) );
|
MAKEINTRESOURCE(IDB_ORIGIN) );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue