Graphic problems with wxtide32
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Thu Oct 21 15:46:43 CDT 2004
Hallo,
wxtide (http://www.wxtide32.com/download.html) is an opne source program
that shows graphic problems. For example, when started, a left click in the
tide window brings up a gray window, where some text should appear. This
window is managed by following code:
static void open_popup(DWORD mouseXY, char *text) {
int mouseX, mouseY, cxscreen, cyscreen, startX, startY, side;
PAINTSTRUCT ps;
RECT purc = {0,0,0,0};
HFONT oldfont;
#define POPUP_BORDER 1
close_popup();
// Open window with dummy position and size to get device context
popup = CreateWindow("STATIC", "", WS_POPUP|WS_VISIBLE,//|WS_BORDER,
10,10,250,50, window, NULL, t_hinst, NULL);
BeginPaint(popup,&ps);
oldfont = SelectFont(ps.hdc,gfont);
// Get extents for this text
DrawText(ps.hdc, text, strlen(text), &purc, DT_CALCRECT);
purc.right += POPUP_BORDER*2;
purc.bottom += POPUP_BORDER*2;
mouseX = LOWORD(mouseXY);
mouseY = HIWORD(mouseXY);
cxscreen = GetSystemMetrics(SM_CXSCREEN);
// cyscreen = GetSystemMetrics(SM_CYFULLSCREEN);
if (side=(cxscreen > (mouseX + winX + purc.right)))
startX = mouseX + winX;
else startX = mouseX + winX - purc.right;
if (0 < (mouseY + winY - purc.bottom))
startY = mouseY + winY - purc.bottom;
else startY = mouseY + winY;
// Now make window the right size and in the right place
MoveWindow(popup,startX,startY,purc.right,purc.bottom,FALSE);
// SetTextColor(ps.hdc,fgtext_color);
// SetBkColor(ps.hdc,RGB(255,255,255));
FillRect( ps.hdc, &purc, GetStockObject(WHITE_BRUSH));
FrameRect(ps.hdc, &purc, GetStockObject(BLACK_BRUSH));
purc.left += POPUP_BORDER;
purc.top += POPUP_BORDER;
purc.right -= POPUP_BORDER;
purc.bottom -= POPUP_BORDER;
DrawText(ps.hdc,text,strlen(text),&purc,
DT_WORDBREAK|(side? DT_LEFT : DT_RIGHT));
SelectFont(ps.hdc,oldfont);
EndPaint(popup,&ps);
}
Any idea what wine is doing wron?
Thanks
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
More information about the wine-devel
mailing list