g_captureWindow = NULL;
m_isBeingDeleted = true;
-
+
// Motif-specific actions first
WXWidget wMain = GetMainWidget();
if ( wMain )
XtVaSetValues(widget, XmNheight, height, NULL);
}
-// For implementation purposes - sometimes decorations make the client area
-// smaller
-wxPoint wxWindow::GetClientAreaOrigin() const
-{
- return wxPoint(0, 0);
-}
-
void wxWindow::DoMoveWindowIntr(int xx, int yy, int w, int h,
int flags)
{
}
else
{
+ if( xx < 0 ) xx = 0;
+ if( yy < 0 ) yy = 0;
if( w < 1 ) w = 1;
if( h < 1 ) h = 1;
{
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);
+ int height;
+
+ wxGetTextExtent (GetXDisplay(), m_font, 1.0,
+ "x", NULL, &height, NULL, NULL);
- // return (overall.ascent + overall.descent);
- return (ascent + descent);
+ return height;
}
int wxWindow::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);
+ int width;
+
+ wxGetTextExtent (GetXDisplay(), m_font, 1.0,
+ "x", &width, NULL, NULL, NULL);
- return overall.width;
+ return width;
}
void wxWindow::GetTextExtent(const wxString& string,
int *descent, int *externalLeading,
const wxFont *theFont) const
{
- wxFont *fontToUse = (wxFont *)theFont;
- if (!fontToUse)
- fontToUse = (wxFont *) & m_font;
+ const wxFont *fontToUse = theFont ? theFont : &m_font;
wxCHECK_RET( fontToUse->Ok(), "valid window font needed" );
-
- WXFontStructPtr pFontStruct = fontToUse->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;
-
+ wxGetTextExtent (GetXDisplay(), *fontToUse, 1.0,
+ string, x, y, NULL, descent);
}
// ----------------------------------------------------------------------------
XtFree ((char *) ptr);
}
- if (x == -1)
- x = 0;
- if (y == -1)
- y = 0;
- SetSize (x, y, width, height);
+ SetInitialBestSize(wxSize(width, height));
- return TRUE;
+ if (x != -1 || y != -1)
+ {
+ if (x == -1)
+ x = 0;
+ if (y == -1)
+ y = 0;
+ Move(x, y);
+ }
+
+ return true;
}
// Remove event handler, remove from hash table