Got dialog sizing to work, downsized fonts a bit (though it always returns

the same standard font right now)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-02-26 21:58:07 +00:00
parent bc55104d9a
commit c2ff68d3fd
6 changed files with 62 additions and 4 deletions

View File

@@ -86,6 +86,12 @@ tar cvf $2/wxMotif-${WXVER}.tar -T /tmp/wxmotif.txt
gzip $2/wxMotif-${WXVER}.tar gzip $2/wxMotif-${WXVER}.tar
mv $2/wxMotif-${WXVER}.tar.gz $2/wxMotif-${WXVER}.tgz mv $2/wxMotif-${WXVER}.tar.gz $2/wxMotif-${WXVER}.tgz
### wxX: combined wxMotif and wxX11 distributions
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/motif.rsp $1/distrib/msw/x11.rsp $1/distrib/msw/contrib.rsp $1/distrib/msw/xml.rsp $1/distrib/msw/ogl.rsp $1/distrib/msw/makefile.rsp $1/distrib/msw/tiff.rsp $1/distrib/msw/jpeg.rsp` | uniq > /tmp/wxx.txt
tar cvf $2/wxWindows-X-${WXVER}.tar -T /tmp/wxx.txt
gzip $2/wxWindows-X-${WXVER}.tar
mv $2/wxWindows-X-${WXVER}.tar.gz $2/wxWindows-X-${WXVER}.tgz
### wxMSW ### wxMSW
ls `cat $1/distrib/msw/msw.rsp $1/distrib/msw/vc.rsp $1/distrib/msw/bc.rsp $1/distrib/msw/contrib.rsp $1/distrib/msw/xml.rsp $1/distrib/msw/makefile.rsp $1/distrib/msw/tiff.rsp $1/distrib/msw/jpeg.rsp` > /tmp/wxmsw.txt ls `cat $1/distrib/msw/msw.rsp $1/distrib/msw/vc.rsp $1/distrib/msw/bc.rsp $1/distrib/msw/contrib.rsp $1/distrib/msw/xml.rsp $1/distrib/msw/makefile.rsp $1/distrib/msw/tiff.rsp $1/distrib/msw/jpeg.rsp` > /tmp/wxmsw.txt
tar cvf $2/wxMSW-${WXVER}.tar -T /tmp/wxmsw.txt tar cvf $2/wxMSW-${WXVER}.tar -T /tmp/wxmsw.txt

View File

@@ -284,6 +284,12 @@ typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
#define KeymapStateMask 0 #define KeymapStateMask 0
#define StructureNotifyMask GR_EVENT_MASK_UPDATE #define StructureNotifyMask GR_EVENT_MASK_UPDATE
#ifdef ConfigureNotify
/* XtoNX.h gets it wrong */
#undef ConfigureNotify
#endif
#define ConfigureNotify GR_EVENT_TYPE_UPDATE
#ifndef FocusIn #ifndef FocusIn
#define FocusIn GR_EVENT_TYPE_FOCUS_IN #define FocusIn GR_EVENT_TYPE_FOCUS_IN
#define FocusOut GR_EVENT_TYPE_FOCUS_OUT #define FocusOut GR_EVENT_TYPE_FOCUS_OUT

View File

@@ -153,6 +153,18 @@ bool wxDialog::Show(bool show)
EndModal(wxID_CANCEL); EndModal(wxID_CANCEL);
} }
// Not sure how to put this in platform-specific
// code just yet. Nano-X has to force a size event,
// else there's no initial size.
#if wxUSE_NANOX
if (show)
{
wxSizeEvent event(GetSize(), GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
#endif
bool ret = wxDialogBase::Show(show); bool ret = wxDialogBase::Show(show);
if ( show ) if ( show )

View File

@@ -614,6 +614,31 @@ static wxNativeFont wxLoadQueryFont(int pointSize,
default: xfamily = wxT("*"); default: xfamily = wxT("*");
} }
#if wxUSE_NANOX #if wxUSE_NANOX
int xweight;
switch (weight)
{
case wxBOLD:
{
xweight = MWLF_WEIGHT_BOLD;
break;
}
case wxLIGHT:
{
xweight = MWLF_WEIGHT_LIGHT;
break;
}
case wxNORMAL:
{
xweight = MWLF_WEIGHT_NORMAL;
break;
}
default:
{
xweight = MWLF_WEIGHT_DEFAULT;
break;
}
}
GR_SCREEN_INFO screenInfo; GR_SCREEN_INFO screenInfo;
GrGetScreenInfo(& screenInfo); GrGetScreenInfo(& screenInfo);
@@ -622,15 +647,24 @@ static wxNativeFont wxLoadQueryFont(int pointSize,
// A point is 1/20 of an inch. // A point is 1/20 of an inch.
// An inch is 2.541 cm. // An inch is 2.541 cm.
// So pixelHeight = (pointSize / 20) (inches) * 2.541 (for cm) * yPixelsPerCM (for pixels) // So pixelHeight = (pointSize / 20) (inches) * 2.541 (for cm) * yPixelsPerCM (for pixels)
// In fact pointSize is 10 * the normal point size so
// divide by 10.
int pixelHeight = (int) ( (((float)pointSize) / 20.0) * 2.541 * (float) yPixelsPerCM) ; // I don't know why this is necessary, but otherwise fonts
// are just too big.
float fudgeFactor = 0.6 ;
int pixelHeight = (int) ( (((float)pointSize) / 200.0) * 2.541 * (float) yPixelsPerCM * fudgeFactor) ;
// An alternative: assume that the screen is 72 dpi.
// This gets a similar result to above (pre-fudge factor)
//int pixelHeight = (int) (((float)pointSize / 200.0) * 72.0) ;
GR_LOGFONT logFont; GR_LOGFONT logFont;
logFont.lfHeight = pixelHeight; logFont.lfHeight = pixelHeight;
logFont.lfWidth = 0; logFont.lfWidth = 0;
logFont.lfEscapement = 0; logFont.lfEscapement = 0;
logFont.lfOrientation = 0; logFont.lfOrientation = 0;
logFont.lfWeight = weight; // TODO: check of conversion req'd logFont.lfWeight = xweight;
logFont.lfItalic = (style == wxNORMAL ? 0 : 1) ; logFont.lfItalic = (style == wxNORMAL ? 0 : 1) ;
logFont.lfUnderline = 0; logFont.lfUnderline = 0;
logFont.lfStrikeOut = 0; logFont.lfStrikeOut = 0;

View File

@@ -518,6 +518,7 @@ void wxApp::ProcessXEvent(WXEvent* _event)
win->GetEventHandler()->ProcessEvent( sizeEvent ); win->GetEventHandler()->ProcessEvent( sizeEvent );
} }
break;
} }
#if !wxUSE_NANOX #if !wxUSE_NANOX
case PropertyNotify: case PropertyNotify:

View File

@@ -163,7 +163,6 @@ bool wxTopLevelWindowX11::Create(wxWindow *parent,
FocusChangeMask | FocusChangeMask |
ColormapChangeMask | ColormapChangeMask |
StructureNotifyMask | StructureNotifyMask |
ConfigureNotify |
PropertyChangeMask PropertyChangeMask
); );