|
From: Mapi B. <ma...@us...> - 2011-04-14 19:25:03
|
Update of /cvsroot/easycalc/PPCport/system - UI
In directory vz-cvs-4.sog:/tmp/cvs-serv3505
Modified Files:
EasyCalc.cpp EasyCalc.h Skin.cpp Skin.h
Log Message:
1.25g-1
Index: EasyCalc.cpp
===================================================================
RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** EasyCalc.cpp 28 Feb 2011 22:13:55 -0000 1.12
--- EasyCalc.cpp 14 Apr 2011 19:25:01 -0000 1.13
***************
*** 75,79 ****
#define MAX_LOADSTRING 100
! #define EASYCALC_APPVERSION _T("1.25g")
#define WM_APP_ENDVMENU (WM_APP+1)
--- 75,79 ----
#define MAX_LOADSTRING 100
! #define EASYCALC_APPVERSION _T("1.25g-1")
#define WM_APP_ENDVMENU (WM_APP+1)
Index: Skin.h
===================================================================
RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Skin.h 28 Feb 2011 22:13:55 -0000 1.12
--- Skin.h 14 Apr 2011 19:25:01 -0000 1.13
***************
*** 248,252 ****
void print_result(HDC hdc);
void paint_result(HDC hdc);
! HBITMAP allocResult(LONG cx, LONG cy);
void deleteResult(void);
void erase_result(HDC hdc);
--- 248,252 ----
void print_result(HDC hdc);
void paint_result(HDC hdc);
! HBITMAP allocResult(HDC hdc, LONG cx, LONG cy);
void deleteResult(void);
void erase_result(HDC hdc);
Index: EasyCalc.h
===================================================================
RCS file: /cvsroot/easycalc/PPCport/system - UI/EasyCalc.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** EasyCalc.h 28 Feb 2011 22:13:55 -0000 1.10
--- EasyCalc.h 14 Apr 2011 19:25:01 -0000 1.11
***************
*** 83,88 ****
/* Magic number and version number for the state file.
- * State file versions correspond to application versions as follows:
- * Version 1: 1.25 first release
*/
#define EASYCALC_MAGIC 0x4543414C
--- 83,86 ----
Index: Skin.cpp
===================================================================
RCS file: /cvsroot/easycalc/PPCport/system - UI/Skin.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Skin.cpp 28 Feb 2011 22:13:55 -0000 1.12
--- Skin.cpp 14 Apr 2011 19:25:01 -0000 1.13
***************
*** 1474,1481 ****
* OS specific: remove result BMP. *
********************************************************************************/
! HBITMAP Skin::allocResult (LONG cx, LONG cy) {
HBITMAP bm;
! bm = CreateCompatibleBitmap(resultDC, cx, cy);
if (bm != NULL) {
oldResultObj = SelectObject(resultDC, bm);
--- 1474,1482 ----
* OS specific: remove result BMP. *
********************************************************************************/
! HBITMAP Skin::allocResult (HDC hdc, LONG cx, LONG cy) {
HBITMAP bm;
! // bm = CreateCompatibleBitmap(resultDC, cx, cy);
! bm = CreateCompatibleBitmap(hdc, cx, cy);
if (bm != NULL) {
oldResultObj = SelectObject(resultDC, bm);
***************
*** 1564,1568 ****
// GetTextExtentPoint32(hdc, g_dispResult, g_result_len, &result_size);
GetTextExtentPoint32(resultDC, g_dispResult, g_result_len, &result_size);
! resultBmp = allocResult(result_size.cx, result_size.cy);
if (resultBmp == NULL) {
SelectObject(resultDC, oldFont); // Set back default object
--- 1565,1569 ----
// GetTextExtentPoint32(hdc, g_dispResult, g_result_len, &result_size);
GetTextExtentPoint32(resultDC, g_dispResult, g_result_len, &result_size);
! resultBmp = allocResult(hdc, result_size.cx, result_size.cy);
if (resultBmp == NULL) {
SelectObject(resultDC, oldFont); // Set back default object
***************
*** 1573,1576 ****
--- 1574,1579 ----
// only set them when BitBlt-ing !!
RECT rcBmp = {0, 0, result_size.cx, result_size.cy};
+ COLORREF oldFg = SetTextColor(resultDC, display_fg);
+ COLORREF oldBg = SetBkColor(resultDC, display_bg);
int oldBgM = SetBkMode(resultDC, OPAQUE);
DrawText(resultDC, g_dispResult, -1, &rcBmp,
***************
*** 1595,1608 ****
scroll |= ANNVAL_SCR_RIGHT;
}
! // Set colors now, because BitBlt-inga monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
BitBlt(hdc, display_loc.x, display_loc.y,
display_w, BIGFONT_SIZE * magnification,
resultDC, result_size.cx - display_w - g_scroll_result, 0, SRCCOPY);
} else {
! // Set colors now, because BitBlt-inga monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
BitBlt(hdc, display_loc.x + display_w - result_size.cx, display_loc.y,
result_size.cx, BIGFONT_SIZE * magnification,
--- 1598,1613 ----
scroll |= ANNVAL_SCR_RIGHT;
}
! // Set colors now, because BitBlt-ing a monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
+ int oldBgM = SetBkMode(hdc, OPAQUE);
BitBlt(hdc, display_loc.x, display_loc.y,
display_w, BIGFONT_SIZE * magnification,
resultDC, result_size.cx - display_w - g_scroll_result, 0, SRCCOPY);
} else {
! // Set colors now, because BitBlt-ing a monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
+ int oldBgM = SetBkMode(hdc, OPAQUE);
BitBlt(hdc, display_loc.x + display_w - result_size.cx, display_loc.y,
result_size.cx, BIGFONT_SIZE * magnification,
***************
*** 1673,1677 ****
resultDC = CreateCompatibleDC(hdc);
}
! // Calculate approximate size with big font only, this will give an overestimate
if (hFontBig_display == NULL) {
LOGFONT lf;
--- 1678,1682 ----
resultDC = CreateCompatibleDC(hdc);
}
! // Calculate overestimated size with big font only
if (hFontBig_display == NULL) {
LOGFONT lf;
***************
*** 1690,1699 ****
GetTextExtentPoint32(resultDC, g_dispResult, g_result_len, &result_size);
// SelectObject(hdc, oldFont); // Set back default object
! resultBmp = allocResult(result_size.cx, result_size.cy);
if (resultBmp == NULL) {
SelectObject(resultDC, oldFont); // Set back default object
return;
}
! // Clear bitmap
RECT rcBmp = {0, 0, result_size.cx, result_size.cy};
COLORREF oldBg = SetBkColor(resultDC, display_bg);
--- 1695,1705 ----
GetTextExtentPoint32(resultDC, g_dispResult, g_result_len, &result_size);
// SelectObject(hdc, oldFont); // Set back default object
! resultBmp = allocResult(hdc, result_size.cx, result_size.cy);
if (resultBmp == NULL) {
SelectObject(resultDC, oldFont); // Set back default object
return;
}
! // Clear bitmap, we'll have to write in transparent mode since small
! // fonts can't set background on the whole height.
RECT rcBmp = {0, 0, result_size.cx, result_size.cy};
COLORREF oldBg = SetBkColor(resultDC, display_bg);
***************
*** 1707,1714 ****
// only set them when BitBlt-ing !!
int oldBgM = SetBkMode(resultDC, TRANSPARENT);
paint_resultpow_rec(resultDC, false, work_dispResult); // Start with normal text.
SelectObject(resultDC, oldFont); // Set back default object
// if (result_size_recompute) { // Was left at true to provoke recomputation of result_size.cx
! HBITMAP bm = CreateCompatibleBitmap(resultDC, result_size.cx, result_size.cy);
if (bm == NULL) {
return;
--- 1713,1722 ----
// only set them when BitBlt-ing !!
int oldBgM = SetBkMode(resultDC, TRANSPARENT);
+ COLORREF oldFg = SetTextColor(resultDC, display_fg);
paint_resultpow_rec(resultDC, false, work_dispResult); // Start with normal text.
SelectObject(resultDC, oldFont); // Set back default object
// if (result_size_recompute) { // Was left at true to provoke recomputation of result_size.cx
! // HBITMAP bm = CreateCompatibleBitmap(resultDC, result_size.cx, result_size.cy);
! HBITMAP bm = CreateCompatibleBitmap(hdc, result_size.cx, result_size.cy);
if (bm == NULL) {
return;
***************
*** 1736,1749 ****
scroll |= ANNVAL_SCR_RIGHT;
}
! // Set colors now, because BitBlt-inga monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
BitBlt(hdc, display_loc.x, display_loc.y,
display_w, BIGFONT_SIZE * magnification,
resultDC, result_size.cx - display_w - g_scroll_result, 0, SRCCOPY);
} else {
! // Set colors now, because BitBlt-inga monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
BitBlt(hdc, display_loc.x + display_w - result_size.cx, display_loc.y,
result_size.cx, BIGFONT_SIZE * magnification,
--- 1744,1759 ----
scroll |= ANNVAL_SCR_RIGHT;
}
! // Set colors now, because BitBlt-ing a monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
+ int oldBgM = SetBkMode(hdc, OPAQUE);
BitBlt(hdc, display_loc.x, display_loc.y,
display_w, BIGFONT_SIZE * magnification,
resultDC, result_size.cx - display_w - g_scroll_result, 0, SRCCOPY);
} else {
! // Set colors now, because BitBlt-ing a monochrome bitmap
COLORREF oldFg = SetTextColor(hdc, display_fg);
COLORREF oldBg = SetBkColor(hdc, display_bg);
+ int oldBgM = SetBkMode(hdc, OPAQUE);
BitBlt(hdc, display_loc.x + display_w - result_size.cx, display_loc.y,
result_size.cx, BIGFONT_SIZE * magnification,
|