#endif //wxUSE_CONSOLEDEBUG
#endif
- //
- // OS2 has to have an anchorblock
- //
- vHab = WinInitialize(0);
-
- if (!vHab)
- return FALSE;
- else
- vHabmain = vHab;
-
- // Some people may wish to use this, but
- // probably it shouldn't be here by default.
-#ifdef __WXDEBUG__
- // wxRedirectIOToConsole();
-#endif
-
wxBuffer = new wxChar[1500]; // FIXME; why?
wxClassInfo::InitializeClasses();
wxBitmap::InitStandardHandlers();
- RegisterWindowClasses(vHab);
+ //
+ // OS2 has to have an anchorblock
+ //
+ vHab = WinInitialize(0);
+
+ if (!vHab)
+ return FALSE;
+ else
+ vHabmain = vHab;
+
+ // Some people may wish to use this, but
+ // probably it shouldn't be here by default.
+#ifdef __WXDEBUG__
+ // wxRedirectIOToConsole();
+#endif
+
wxWinHandleList = new wxList(wxKEY_INTEGER);
// This is to foil optimizations in Visual C++ that throw out dummy.obj.
wxModule::RegisterModules();
if (!wxModule::InitializeModules())
return FALSE;
+ RegisterWindowClasses(vHab);
return TRUE;
} // end of wxApp::Initialize
if (!::WinRegisterClass( vHab
,wxCanvasClassName
,wxWndProc
- ,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT | CS_CLIPCHILDREN
+ ,CS_SIZEREDRAW | CS_HITTEST | CS_SYNCPAINT
,sizeof(ULONG)
))
{
if (pMsg->msg == WM_TIMER)
wxTimerProc(NULL, 0, (int)pMsg->mp1, 0);
+ //
+ // Allow the window to prevent certain messages from being
+ // translated/processed (this is currently used by wxTextCtrl to always
+ // grab Ctrl-C/V/X, even if they are also accelerators in some parent)
+ //
+ if (pWndThis && !pWndThis->OS2ShouldPreProcessMessage(pWxmsg))
+ {
+ return FALSE;
+ }
+
//
// For some composite controls (like a combobox), wndThis might be NULL
// because the subcontrol is not a wxWindow, but only the control itself
{
wxFillLogFont( &m_vNativeFontInfo.fa
,&m_vNativeFontInfo.fn
- ,m_hPS
+ ,&m_hPS
,&flId
,sFaceName
,pFont
m_nFamily = wxSCRIPT;
else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Courier New") == 0)
m_nFamily = wxMODERN;
+ else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Courier") == 0)
+ m_nFamily = wxMODERN;
else
m_nFamily = wxSWISS;
void wxFillLogFont(
LOGFONT* pFattrs // OS2 GPI FATTRS
, PFACENAMEDESC pFaceName
-, HPS hPS
+, HPS* phPS
, long* pflId
, wxString& sFaceName
, wxFont* pFont
{
LONG lNumFonts = 0L; // For system font count
ERRORID vError; // For logging API errors
- LONG lTemp;
+ LONG lTemp = 0L;
bool bInternalPS = FALSE; // if we have to create one
PFONTMETRICS pFM = NULL;
// Initial house cleaning to free data buffers and ensure we have a
// functional PS to work with
//
- if (!hPS)
+ if (!*phPS)
{
- hPS = ::WinGetPS(HWND_DESKTOP);
+ *phPS = ::WinGetPS(HWND_DESKTOP);
bInternalPS = TRUE;
}
//
// Determine the number of fonts.
//
- lNumFonts = ::GpiQueryFonts( hPS
- ,QF_PUBLIC
- ,NULL
- ,&lTemp
- ,(LONG) sizeof(FONTMETRICS)
- ,NULL
- );
+ if((lNumFonts = ::GpiQueryFonts( *phPS
+ ,QF_PUBLIC
+ ,NULL
+ ,&lTemp
+ ,(LONG) sizeof(FONTMETRICS)
+ ,NULL
+ )) < 0L)
+ {
+ ERRORID vError;
+ wxString sError;
+
+ vError = ::WinGetLastError(wxGetInstance());
+ sError = wxPMErrorToStr(vError);
+ return;
+ }
//
// Allocate space for the font metrics.
// Retrieve the font metrics.
//
lTemp = lNumFonts;
- lTemp = ::GpiQueryFonts( hPS
+ lTemp = ::GpiQueryFonts( *phPS
,QF_PUBLIC
,NULL
,&lTemp
// We should now have the correct FATTRS set with the selected
// font, so now we need to generate an ID
//
- long lNumLids = ::GpiQueryNumberSetIds(hPS);
+ long lNumLids = ::GpiQueryNumberSetIds(*phPS);
long lGpiError;
if(lNumLids )
STR8 azNames[255];
long alIds[255];
- if(!::GpiQuerySetIds( hPS
+ if(!::GpiQuerySetIds( *phPS
,lNumLids
,alTypes
,azNames
))
{
if (bInternalPS)
- ::WinReleasePS(hPS);
+ ::WinReleasePS(*phPS);
return;
}
if(*pflId > 254) // wow, no id available!
{
if (bInternalPS)
- ::WinReleasePS(hPS);
+ ::WinReleasePS(*phPS);
return;
}
}
-
+ else
+ *pflId = 1L;
//
// Release and delete the current font
//
- ::GpiSetCharSet(hPS, LCID_DEFAULT);/* release the font before deleting */
- ::GpiDeleteSetId(hPS, 1L); /* delete the logical font */
+ ::GpiSetCharSet(*phPS, LCID_DEFAULT);/* release the font before deleting */
+ ::GpiDeleteSetId(*phPS, 1L); /* delete the logical font */
//
// Now build a facestring
strcpy(zFacename, pFattrs->szFacename);
- if(::GpiQueryFaceString( hPS
+ if(::GpiQueryFaceString( *phPS
,zFacename
,pFaceName
,FACESIZE
if( !pStatusBar )
return NULL;
+ wxClientDC vDC(pStatusBar);
+ int nY;
+
+ //
+ // Set the height according to the font and the border size
+ //
+ vDC.SetFont(pStatusBar->GetFont()); // Screws up the menues for some reason
+ vDC.GetTextExtent( "X"
+ ,NULL
+ ,&nY
+ );
+
+ int nHeight = ((11 * nY) / 10 + 2 * pStatusBar->GetBorderY());
+
+ pStatusBar->SetSize( -1
+ ,-1
+ ,-1
+ ,nHeight
+ );
+
::WinSetParent( pStatusBar->GetHWND()
,m_hFrame
,FALSE
return (WXHBRUSH)pBackgroundBrush->GetResourceHandle();
} // end of wxTextCtrl::OnCtlColor
+bool wxTextCtrl::OS2ShouldPreProcessMessage(
+ WXMSG* pMsg
+)
+{
+ return wxControl::OS2ShouldPreProcessMessage(pMsg);
+} // end of wxTextCtrl::OS2ShouldPreProcessMessage
+
void wxTextCtrl::OnChar(
wxKeyEvent& rEvent
)
wxAssociateWinWithHandle(m_hWnd, this);
wxAssociateWinWithHandle(m_hFrame, this);
- m_backgroundColour.Set(wxString("GREY"));
+ m_backgroundColour.Set(wxString("DARK GREY"));
LONG lColor = (LONG)m_backgroundColour.GetPixel();
wxLogError("Error sizing frame. Error: %s\n", sError);
return FALSE;
}
+ lStyle = ::WinQueryWindowULong( m_hWnd
+ ,QWL_STYLE
+ );
+ lStyle |= WS_CLIPCHILDREN;
+ ::WinSetWindowULong( m_hWnd
+ ,QWL_STYLE
+ ,lStyle
+ );
return TRUE;
} // end of wxTopLevelWindowOS2::CreateFrame
int nShowCmd
)
{
- ::WinShowWindow(m_hFrame, (BOOL)nShowCmd);
+ ::WinShowWindow(m_hFrame, (BOOL)(nShowCmd & SWP_SHOW));
m_bIconized = nShowCmd == SWP_MINIMIZE;
} // end of wxTopLevelWindowOS2::DoShowWindow
{
if (m_bMaximizeOnShow)
{
- nShowCmd = SWP_SHOW;
+ nShowCmd = SWP_MAXIMIZE;
m_bMaximizeOnShow = FALSE;
}
else
{
- nShowCmd = SWP_HIDE;
+ nShowCmd = SWP_SHOW;
}
}
else // hide
#endif //wxUSE_ACCEL
} // end of wxWindowOS2::OS2TranslateMessage
+bool wxWindowOS2::OS2ShouldPreProcessMessage(
+ WXMSG* pMsg
+)
+{
+ // preprocess all messages by default
+ return TRUE;
+} // end of wxWindowOS2::OS2ShouldPreProcessMessage
+
// ---------------------------------------------------------------------------
// message params unpackers
// ---------------------------------------------------------------------------
WXHWND WXUNUSED(hWnd)
)
{
+ //
+ // Notify the parent keeping track of focus for the kbd navigation
+ // purposes that we got it
+ //
+ wxChildFocusEvent vEventFocus((wxWindow *)this);
+ (void)GetEventHandler()->ProcessEvent(vEventFocus);
+
#if wxUSE_CARET
//
// Deal with caret
wxGetNativeFontEncoding__F14wxFontEncodingP20wxNativeEncodingInfo
;wxOS2SelectMatchingFontByName(_FATTRS*,_FACENAMEDESC*,_FONTMETRICS*,int,const wxFont*)
wxOS2SelectMatchingFontByName__FP7_FATTRSP13_FACENAMEDESCP12_FONTMETRICSiPC6wxFont
- ;wxFillLogFont(_FATTRS*,_FACENAMEDESC*,unsigned long,long*,wxString&,wxFont*)
- wxFillLogFont__FP7_FATTRSP13_FACENAMEDESCUlPlR8wxStringP6wxFont
+ ;wxFillLogFont(_FATTRS*,_FACENAMEDESC*,unsigned long*,long*,wxString&,wxFont*)
+ wxFillLogFont__FP7_FATTRSP13_FACENAMEDESCPUlPlR8wxStringP6wxFont
;wxGpiStrcmp(char*,char*)
wxGpiStrcmp__FPcT1
;wxNativeEncodingInfo::FromString(const wxString&)
Cut__10wxTextCtrlFv
;wxTextCtrl::SetInsertionPointEnd()
SetInsertionPointEnd__10wxTextCtrlFv
+ ;wxTextCtrl::OS2ShouldPreProcessMessage(void**)
+ OS2ShouldPreProcessMessage__10wxTextCtrlFPPv
;wxTextCtrl::DiscardEdits()
DiscardEdits__10wxTextCtrlFv
;wxTextCtrl::CanUndo() const
OS2WindowProc__8wxWindowFUiPvT2
;wxWindow::OS2TranslateMessage(void**)
OS2TranslateMessage__8wxWindowFPPv
+ ;wxWindow::OS2ShouldPreProcessMessage(void**)
+ OS2ShouldPreProcessMessage__8wxWindowFPPv
;wxWindow::OS2DefWindowProc(unsigned int,void*,void*)
OS2DefWindowProc__8wxWindowFUiPvT2
;wxWindow::HandleMinimize()