-
- Widget widget = (Widget) frame->GetShellWidget();
-
- if (minW > -1)
- XtVaSetValues(widget, XmNminWidth, minW, NULL);
- if (minH > -1)
- XtVaSetValues(widget, XmNminHeight, minH, NULL);
- if (maxW > -1)
- XtVaSetValues(widget, XmNmaxWidth, maxW, NULL);
- if (maxH > -1)
- XtVaSetValues(widget, XmNmaxHeight, maxH, NULL);
- if (incW > -1)
- XtVaSetValues(widget, XmNwidthInc, incW, NULL);
- if (incH > -1)
- XtVaSetValues(widget, XmNheightInc, incH, NULL);
-#endif
-}
-
-void wxWindowX11::DoMoveWindow(int x, int y, int width, int height)
-{
- // TODO
-#if 0
- XtVaSetValues((Widget)GetTopWidget(),
- XmNx, x,
- XmNy, y,
- XmNwidth, width,
- XmNheight, height,
- NULL);
-#endif
-}
-
-// ---------------------------------------------------------------------------
-// text metrics
-// ---------------------------------------------------------------------------
-
-int wxWindowX11::GetCharHeight() const
-{
- wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" );
-
- WXFontStructPtr pFontStruct = m_font.GetFontStruct(1.0, GetXDisplay());
-
- int direction, ascent, descent;
- XCharStruct overall;
- XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
- &descent, &overall);
-
- // return (overall.ascent + overall.descent);
- return (ascent + descent);
-}
-
-int wxWindowX11::GetCharWidth() const
-{
- wxCHECK_MSG( m_font.Ok(), 0, "valid window font needed" );
-
- WXFontStructPtr pFontStruct = m_font.GetFontStruct(1.0, GetXDisplay());
-
- int direction, ascent, descent;
- XCharStruct overall;
- XTextExtents ((XFontStruct*) pFontStruct, "x", 1, &direction, &ascent,
- &descent, &overall);
-
- return overall.width;
-}
-
-void wxWindowX11::GetTextExtent(const wxString& string,
- int *x, int *y,
- int *descent, int *externalLeading,
- const wxFont *theFont) const
-{
- wxFont *fontToUse = (wxFont *)theFont;
- if (!fontToUse)
- fontToUse = (wxFont *) & m_font;
-
- wxCHECK_RET( fontToUse->Ok(), "valid window font needed" );
-
- WXFontStructPtr pFontStruct = theFont->GetFontStruct(1.0, GetXDisplay());
-
- int direction, ascent, descent2;
- XCharStruct overall;
- int slen = string.Len();
-
-#if 0
- if (use16)
- XTextExtents16((XFontStruct*) pFontStruct, (XChar2b *) (char*) (const char*) string, slen, &direction,
- &ascent, &descent2, &overall);
-#endif
-
- XTextExtents((XFontStruct*) pFontStruct, string, slen,
- &direction, &ascent, &descent2, &overall);
-
- if ( x )
- *x = (overall.width);
- if ( y )
- *y = (ascent + descent2);
- if (descent)
- *descent = descent2;
- if (externalLeading)
- *externalLeading = 0;
-
-}
-
-// ----------------------------------------------------------------------------
-// painting
-// ----------------------------------------------------------------------------
-
-void wxWindowX11::Refresh(bool eraseBack, const wxRect *rect)
-{
- m_needsRefresh = TRUE;
- Display *display = wxGetDisplay();
- Window thisWindow = (Widget) GetMainWindow();
-
- XExposeEvent dummyEvent;
- int width, height;
- GetSize(&width, &height);
-
- dummyEvent.type = Expose;
- dummyEvent.display = display;
- dummyEvent.send_event = True;
- dummyEvent.window = thisWindow;
- if (rect)