void SetRadioGroupStart(int nStart);
void SetRadioGroupEnd(int nEnd);
-
//
// All OS/2PM Submenus and menus have one of these
//
virtual void WriteText(const wxString& rsText);
virtual void AppendText(const wxString& rsText);
+ virtual bool EmulateKeyPress(const wxKeyEvent& rEvent);
virtual bool SetStyle( long lStart
,long lEnd
,WXLPARAM lParam
,bool bIsASCII = FALSE
);
- bool HandleKeyDown( WXWORD wParam
+ bool HandleKeyDown( WXWPARAM wParam
,WXLPARAM lParam
);
- bool HandleKeyUp( WXDWORD wParam
+ bool HandleKeyUp( WXWPARAM wParam
,WXLPARAM lParam
);
bool HandleQueryDragIcon(WXHICON* phIcon);
,WXLPARAM* pResult
);
// the helper functions used by HandleChar/KeyXXX methods
- wxKeyEvent CreateKeyEvent(wxEventType evType, int id, WXLPARAM lp) const;
+ wxKeyEvent CreateKeyEvent( wxEventType evType
+ ,int nId
+ ,WXLPARAM lParam = 0
+ ,WXWPARAM wParam = 0
+ ) const;
DECLARE_DYNAMIC_CLASS(wxWindowOS2);
)
{
wxCHECK_MSG(rImage.Ok(), FALSE, wxT("invalid image"));
+ m_refData = new wxBitmapRefData();
int nSizeLimit = 1024 * 768 * 3;
- int nWidth = GetWidth();
- int nBmpHeight = GetHeight();
+ int nWidth = rImage.GetWidth();
+ int nBmpHeight = rImage.GetHeight();
int nBytePerLine = nWidth * 3;
int nSizeDWORD = sizeof(DWORD);
int nLineBoundary = nBytePerLine % nSizeDWORD;
, const wxString& rsName
)
{
- SetName(rsName);
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
#if wxUSE_VALIDATORS
- SetValidator(rValidator);
+ ,wxDefaultValidator
#endif
- if (pParent)
- pParent->AddChild(this);
-
- SetBackgroundColour(pParent->GetBackgroundColour());
- SetForegroundColour(pParent->GetForegroundColour());
- m_windowStyle = lStyle;
-
- wxString sLabel = rsLabel;
-
- if (sLabel == wxT(""))
- sLabel = wxT(" "); // Apparently needed or checkbox won't show
-
- if (vId == -1 )
- m_windowId = NewControlId();
- else
- m_windowId = vId;
-
- int nX = rPos.x;
- int nY = rPos.y;
- int nWidth = rSize.x;
- int nHeight = rSize.y;
- long lSstyle = 0L;
-
- lSstyle = BS_AUTOCHECKBOX |
- WS_TABSTOP |
- WS_VISIBLE;
- if (lStyle & wxCLIP_SIBLINGS )
- lSstyle |= WS_CLIPSIBLINGS;
-
- m_hWnd = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
- ,WC_BUTTON
- ,rsLabel.c_str()
- ,lSstyle
- ,0, 0, 0, 0
- ,GetWinHwnd(pParent)
- ,HWND_TOP
- ,(HMENU)m_windowId
- ,NULL
- ,NULL
- );
-
- //
- // Subclass again for purposes of dialog editing mode
- //
- SubclassWin(m_hWnd);
-
- LONG lColor = (LONG)m_backgroundColour.GetPixel();
-
- ::WinSetPresParam( m_hWnd
- ,PP_BACKGROUNDCOLOR
- ,sizeof(LONG)
- ,(PVOID)&lColor
- );
-
- wxFont* pTextFont = new wxFont( 10
- ,wxMODERN
- ,wxNORMAL
- ,wxNORMAL
- );
- SetFont(*pTextFont);
- SetSize( nX
- ,nY
- ,nWidth
- ,nHeight
- );
- delete pTextFont;
- return TRUE;
+ ,rsName
+ ))
+ return FALSE;
+
+ long osStyle = BS_AUTOCHECKBOX |
+ WS_TABSTOP |
+ WS_VISIBLE;
+
+ return OS2CreateControl( wxT("BUTTON")
+ ,osStyle
+ ,rPos
+ ,rSize
+ ,rsLabel
+ ,0
+ );
} // end of wxCheckBox::Create
void wxCheckBox::SetLabel(
));
case KC_PREVDOWN:
- return (HandleKeyDown( SHORT1FROMMP(wParam)
+ return (HandleKeyDown( wParam
,lParam
));
case KC_KEYUP:
- return (HandleKeyUp( SHORT1FROMMP(wParam)
+ return (HandleKeyUp( wParam
,lParam
));
}
,&vInfo
))
{
-#if wxUSE_FONTMAP
if (wxFontMapper::Get()->GetAltForEncoding( eEncoding
,&vInfo
))
}
}
else
-#endif // wxUSE_FONTMAP
{
// unsupported encoding, replace with the default
vInfo.charset = 850;
wxMenuItem* pItem
)
{
- //
- // Find the (new) accel for this item
- //
- wxAcceleratorEntry* pAccel = wxGetAccelFromString(pItem->GetText());
-
- if (pAccel)
- pAccel->m_command = pItem->GetId();
-
- //
- // Find the old one
- //
- int n = FindAccel(pItem->GetId());
+ if (pItem->IsSubMenu())
+ {
+ wxMenu* pSubmenu = pItem->GetSubMenu();
+ wxMenuItemList::Node* pNode = pSubmenu->GetMenuItems().GetFirst();
- if (n == wxNOT_FOUND)
+ while (pNode)
+ {
+ UpdateAccel(pNode->GetData());
+ pNode = pNode->GetNext();
+ }
+ }
+ else if (!pItem->IsSeparator())
{
//
- // No old, add new if any
+ // Find the (new) accel for this item
//
+ wxAcceleratorEntry* pAccel = wxGetAccelFromString(pItem->GetText());
if (pAccel)
- m_vAccels.Add(pAccel);
- else
- return; // skipping RebuildAccelTable() below
- }
- else
- {
+ pAccel->m_command = pItem->GetId();
+
//
- // Replace old with new or just remove the old one if no new
+ // Find the old one
//
- delete m_vAccels[n];
+ int n = FindAccel(pItem->GetId());
- if (pAccel)
- m_vAccels[n] = pAccel;
+ if (n == wxNOT_FOUND)
+ {
+ //
+ // No old, add new if any
+ //
+ if (pAccel)
+ m_vAccels.Add(pAccel);
+ else
+ return; // skipping RebuildAccelTable() below
+ }
else
- m_vAccels.RemoveAt(n);
- }
+ {
+ //
+ // Replace old with new or just remove the old one if no new
+ //
+ delete m_vAccels[n];
- if (IsAttached())
- {
- m_menuBar->RebuildAccelTable();
+ if (pAccel)
+ m_vAccels[n] = pAccel;
+ else
+ m_vAccels.RemoveAt(n);
+ }
+
+ if (IsAttached())
+ {
+ m_menuBar->RebuildAccelTable();
+ }
}
} // wxMenu::UpdateAccel
m_vRadioGroup.m_nEnd = nEnd;
} // end of wxMenuItem::SetRadioGroupEnd
+
// change item state
// -----------------
return;
HMENU hMenu = GetHmenuOf(m_parentMenu);
-
if ( GetKind() == wxITEM_RADIO )
{
//
::WinSetWindowText(GetHwnd(), "");
} // end of wxTextCtrl::Clear
+bool wxTextCtrl::EmulateKeyPress(
+ const wxKeyEvent& rEvent
+)
+{
+ SetFocus();
+ return(wxTextCtrlBase::EmulateKeyPress(rEvent));
+} // end of wxTextCtrl::EmulateKeyPress
+
// ----------------------------------------------------------------------------
// Clipboard operations
// ----------------------------------------------------------------------------
# define CW_USEDEFAULT ((int)0x80000000)
#endif
+#ifndef VK_OEM_1
+ #define VK_OEM_1 0xBA
+ #define VK_OEM_PLUS 0xBB
+ #define VK_OEM_COMMA 0xBC
+ #define VK_OEM_MINUS 0xBD
+ #define VK_OEM_PERIOD 0xBE
+ #define VK_OEM_2 0xBF
+ #define VK_OEM_3 0xC0
+ #define VK_OEM_4 0xDB
+ #define VK_OEM_5 0xDC
+ #define VK_OEM_6 0xDD
+ #define VK_OEM_7 0xDE
+#endif
+
// ---------------------------------------------------------------------------
// global variables
// ---------------------------------------------------------------------------
if (uKeyFlags & KC_KEYUP)
{
//TODO: check if the cast to WXWORD isn't causing trouble
- bProcessed = HandleKeyUp((WXDWORD)wParam, lParam);
+ bProcessed = HandleKeyUp(wParam, lParam);
break;
}
else // keydown event
// return 0 now (we've handled it). DON't RETURN
// we still need to process further
//
- HandleKeyDown((WXDWORD)wParam, lParam);
- m_bLastKeydownProcessed = TRUE;
+ m_bLastKeydownProcessed = HandleKeyDown(wParam, lParam);
if (uKeyFlags & KC_VIRTUALKEY)
{
USHORT uVk = SHORT2FROMMP((MPARAM)lParam);
//
// We consider these message "not interesting" to OnChar
//
- if (uVk == VK_SHIFT || uVk == VK_CTRL )
- {
- bProcessed = TRUE;
- break;
- }
switch(uVk)
{
- //
+ case VK_SHIFT:
+ case VK_CTRL:
+ case VK_MENU:
+ case VK_CAPSLOCK:
+ case VK_NUMLOCK:
+ case VK_SCRLLOCK:
+ bProcessed = TRUE;
+ break;
+
// Avoid duplicate messages to OnChar for these ASCII keys: they
// will be translated by TranslateMessage() and received in WM_CHAR
case VK_ESC:
bProcessed = FALSE;
break;
- case VK_LEFT:
- case VK_RIGHT:
- case VK_DOWN:
- case VK_UP:
default:
- bProcessed = HandleChar((WXDWORD)wParam, lParam);
+ if (m_bLastKeydownProcessed)
+ {
+ //
+ // The key was handled in the EVT_KEY_DOWN and handling
+ // a key in an EVT_KEY_DOWN handler is meant, by
+ // design, to prevent EVT_CHARs from happening
+ //
+ m_bLastKeydownProcessed = FALSE;
+ bProcessed = TRUE;
+ }
+ else // do generate a CHAR event
+ {
+ bProcessed = HandleChar((WXDWORD)wParam, lParam);
+ }
}
break;
}
else // WM_CHAR -- Always an ASCII character
{
- bProcessed = HandleChar((WXDWORD)wParam, lParam, TRUE);
- break;
+ if (m_bLastKeydownProcessed)
+ {
+ //
+ // The key was handled in the EVT_KEY_DOWN and handling
+ // a key in an EVT_KEY_DOWN handler is meant, by
+ // design, to prevent EVT_CHARs from happening
+ //
+ m_bLastKeydownProcessed = FALSE;
+ bProcessed = TRUE;
+ }
+ else // do generate a CHAR event
+ {
+ bProcessed = HandleChar((WXDWORD)wParam, lParam, TRUE);
+ break;
+ }
}
}
}
wxEventType eType
, int nId
, WXLPARAM lParam
+, WXWPARAM wParam
) const
{
wxKeyEvent vEvent(eType);
vEvent.m_eventObject = (wxWindow *)this; // const_cast
vEvent.m_keyCode = nId;
+ vEvent.m_rawCode = (wxUint32)wParam;
+ vEvent.m_rawFlags = (wxUint32)lParam;
vEvent.SetTimestamp(s_currentMsg.time);
//
default:
bCtrlDown = TRUE;
- vId = vId + 96;
+ vId = vId + 'a' - 1;
}
}
}
- else if ( (vId = wxCharCodeOS2ToWX(wParam)) == 0)
+ else // we're called from WM_KEYDOWN
{
- //
- // It's ASCII and will be processed here only when called from
- // WM_CHAR (i.e. when isASCII = TRUE), don't process it now
- //
- vId = -1;
+ vId = wxCharCodeOS2ToWX(wParam);
+ if (vId == 0)
+ return FALSE;
}
- if (vId != -1)
- {
- wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR
+ wxKeyEvent vEvent(CreateKeyEvent( wxEVT_CHAR
,vId
,lParam
));
- if (bCtrlDown)
- {
- vEvent.m_controlDown = TRUE;
- }
-
- if (GetEventHandler()->ProcessEvent(vEvent))
- return TRUE;
+ if (bCtrlDown)
+ {
+ vEvent.m_controlDown = TRUE;
}
- return FALSE;
+ return (GetEventHandler()->ProcessEvent(vEvent));
}
bool wxWindowOS2::HandleKeyDown(
- WXWORD wParam
+ WXWPARAM wParam
, WXLPARAM lParam
)
{
- int nId = wxCharCodeOS2ToWX(wParam);
+ int nId = wxCharCodeOS2ToWX((int)wParam);
if (!nId)
{
//
// Normal ASCII char
//
- nId = wParam;
+ nId = (int)wParam;
}
if (nId != -1)
{
wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_DOWN
,nId
- ,lParam
+ ,(MPARAM)lParam
+ ,(MPARAM)wParam
));
if (GetEventHandler()->ProcessEvent(vEvent))
} // end of wxWindowOS2::HandleKeyDown
bool wxWindowOS2::HandleKeyUp(
- WXDWORD wParam
+ WXWPARAM wParam
, WXLPARAM lParam
)
{
- int nId = wxCharCodeOS2ToWX(wParam);
+ int nId = wxCharCodeOS2ToWX((int)wParam);
if (!nId)
{
//
// Normal ASCII char
//
- nId = wParam;
+ nId = (int)wParam;
}
if (nId != -1)
wxKeyEvent vEvent(CreateKeyEvent( wxEVT_KEY_UP
,nId
,lParam
+ ,wParam
));
if (GetEventHandler()->ProcessEvent(vEvent))
case VK_PRINTSCRN: nId = WXK_PRINT; break;
case VK_INSERT: nId = WXK_INSERT; break;
case VK_DELETE: nId = WXK_DELETE; break;
+ case VK_CAPSLOCK: nId = WXK_CAPITAL; break;
case VK_F1: nId = WXK_F1; break;
case VK_F2: nId = WXK_F2; break;
case VK_F3: nId = WXK_F3; break;
case VK_F22: nId = WXK_F22; break;
case VK_F23: nId = WXK_F23; break;
case VK_F24: nId = WXK_F24; break;
+ case VK_OEM_1: nId = ';'; break;
+ case VK_OEM_PLUS: nId = '+'; break;
+ case VK_OEM_COMMA: nId = ','; break;
+ case VK_OEM_MINUS: nId = '-'; break;
+ case VK_OEM_PERIOD: nId = '.'; break;
+ case VK_OEM_2: nId = '/'; break;
+ case VK_OEM_3: nId = '~'; break;
+ case VK_OEM_4: nId = '['; break;
+ case VK_OEM_5: nId = '\\'; break;
+ case VK_OEM_6: nId = ']'; break;
+ case VK_OEM_7: nId = '\''; break;
case VK_NUMLOCK: nId = WXK_NUMLOCK; break;
case VK_SCRLLOCK: nId = WXK_SCROLL; break;
default:
CODE LOADONCALL
EXPORTS
-;From library: H:\DEV\WX2\WXWINDOWS\LIB\wx.lib
+;From library: H:\Dev\Wx2\WxWindows\lib\wx.lib
;From object file: dummy.cpp
;PUBDEFs (Symbols available from object file):
wxDummyChar
PrependDir__10wxFileNameFRC8wxString
;wxFileName::GetPathSeparators(wxPathFormat)
GetPathSeparators__10wxFileNameF12wxPathFormat
- ;wxFileName::Mkdir(const wxString&,int,unsigned long)
- Mkdir__10wxFileNameFRC8wxStringiUl
;wxFileName::IsPathSeparator(char,wxPathFormat)
IsPathSeparator__10wxFileNameFc12wxPathFormat
;wxFileName::GetFullPath(wxPathFormat) const
GetFullPath__10wxFileNameCF12wxPathFormat
+ ;wxFileName::Mkdir(const wxString&,int,int)
+ Mkdir__10wxFileNameFRC8wxStringiT2
;wxFileName::Touch()
Touch__10wxFileNameFv
;wxFileName::FileName(const wxString&)
IsAbsolute__10wxFileNameCF12wxPathFormat
;wxFileName::GetVolumeSeparator(wxPathFormat)
GetVolumeSeparator__10wxFileNameF12wxPathFormat
- ;wxFileName::GetPath(unsigned long,wxPathFormat) const
- GetPath__10wxFileNameCFUl12wxPathFormat
;wxFileName::RemoveDir(int)
RemoveDir__10wxFileNameFi
;wxFileName::wxPathExists()
SplitPath__10wxFileNameFRC8wxStringP8wxStringN3212wxPathFormat
;wxFileName::Normalize(int,const wxString&,wxPathFormat)
Normalize__10wxFileNameFiRC8wxString12wxPathFormat
- ;wxFileName::Mkdir(int,unsigned long)
- Mkdir__10wxFileNameFiUl
;wxFileName::MakeRelativeTo(const wxString&,wxPathFormat)
MakeRelativeTo__10wxFileNameFRC8wxString12wxPathFormat
;wxFileName::AssignDir(const wxString&,wxPathFormat)
AssignDir__10wxFileNameFRC8wxString12wxPathFormat
+ ;wxFileName::Mkdir(int,int)
+ Mkdir__10wxFileNameFiT1
;wxFileName::SetTimes(const wxDateTime*,const wxDateTime*,const wxDateTime*)
SetTimes__10wxFileNameFPC10wxDateTimeN21
;wxFileName::Rmdir()
SplitPath__10wxFileNameFRC8wxStringP8wxStringN2212wxPathFormat
;wxFileName::IsCaseSensitive(wxPathFormat)
IsCaseSensitive__10wxFileNameF12wxPathFormat
+ ;wxFileName::GetPath(int,wxPathFormat) const
+ GetPath__10wxFileNameCFi12wxPathFormat
;wxFileName::GetFormat(wxPathFormat)
GetFormat__10wxFileNameF12wxPathFormat
;wxFileName::Assign(const wxFileName&)
GetEncodingName__12wxFontMapperF14wxFontEncoding
;wxFontMapper::~wxFontMapper()
__dt__12wxFontMapperFv
+ ;wxFontMapper::sm_instance
+ sm_instance__12wxFontMapper
+ ;wxFontMapper::Set(wxFontMapper*)
+ Set__12wxFontMapperFP12wxFontMapper
+ ;wxFontMapper::Get()
+ Get__12wxFontMapperFv
;wxFontMapper::GetDefaultConfigPath()
GetDefaultConfigPath__12wxFontMapperFv
;wxFontMapper::GetEncodingDescription(wxFontEncoding)
HasOption__7wxImageCFRC8wxString
;From object file: ..\common\imagfill.cpp
;PUBDEFs (Symbols available from object file):
- ;wxImage::MatchBoundaryPixel(int,int,int,int,const wxColour&,const wxColour&)
- MatchBoundaryPixel__7wxImageFiN31RC8wxColourT5
- ;wxImage::DoFloodFill(int,int,const wxBrush&,const wxColour&,int,int)
- DoFloodFill__7wxImageFiT1RC7wxBrushRC8wxColourN21
- ;wxImage::MatchPixel(int,int,int,int,const wxColour&)
- MatchPixel__7wxImageFiN31RC8wxColour
+ ;wxDoFloodFill(wxDC*,int,int,const wxColour&,int)
+ wxDoFloodFill__FP4wxDCiT2RC8wxColourT2
;From object file: ..\common\imaggif.cpp
;PUBDEFs (Symbols available from object file):
;wxGIFHandler::SaveFile(wxImage*,wxOutputStream&,unsigned long)
SaveFile__14wxTextCtrlBaseFRC8wxString
;wxTextCtrlBase::operator<<(const char)
__ls__14wxTextCtrlBaseFCc
+ ;wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent&)
+ EmulateKeyPress__14wxTextCtrlBaseFRC10wxKeyEvent
__vft14wxTextCtrlBase8wxObject
;wxTextAttr::Combine(const wxTextAttr&,const wxTextAttr&,const wxTextCtrlBase*)
Combine__10wxTextAttrFRC10wxTextAttrT1PC14wxTextCtrlBase
;wxGenericDirDialog::OnNew(wxCommandEvent&)
OnNew__18wxGenericDirDialogFR14wxCommandEvent
__vft18wxGenericDirDialog8wxObject
+ ;wxGenericDirDialog::OnGoHome(wxCommandEvent&)
+ OnGoHome__18wxGenericDirDialogFR14wxCommandEvent
;wxGenericDirDialog::wxGenericDirDialog(wxWindow*,const wxString&,const wxString&,long,const wxPoint&,const wxSize&,const wxString&)
__ct__18wxGenericDirDialogFP8wxWindowRC8wxStringT2lRC7wxPointRC6wxSizeT2
;wxGenericDirDialog::ShowModal()
OS2DestroyWindow__8wxWindowFv
;wxWindow::IsMouseInWindow() const
IsMouseInWindow__8wxWindowCFv
- ;wxWindow::HandleKeyUp(unsigned long,void*)
- HandleKeyUp__8wxWindowFUlPv
- ;wxWindow::HandleKeyDown(unsigned short,void*)
- HandleKeyDown__8wxWindowFUsPv
;wxWindow::Clear()
Clear__8wxWindowFv
;wxRemoveHandleAssociation(wxWindow*)
Reparent__8wxWindowFP8wxWindow
;wxWindow::OS2GetCreateWindowCoords(const wxPoint&,const wxSize&,int&,int&,int&,int&) const
OS2GetCreateWindowCoords__8wxWindowCFRC7wxPointRC6wxSizeRiN33
+ ;wxWindow::CreateKeyEvent(int,int,void*,void*) const
+ CreateKeyEvent__8wxWindowCFiT1PvT3
;wxWindow::Enable(unsigned long)
Enable__8wxWindowFUl
wxWinHandleList
HandleMove__8wxWindowFiT1
;wxWindow::HandleMouseEvent(unsigned int,int,int,unsigned int)
HandleMouseEvent__8wxWindowFUiiT2T1
+ ;wxWindow::HandleKeyDown(void*,void*)
+ HandleKeyDown__8wxWindowFPvT1
;wxWindow::GetScrollRange(int) const
GetScrollRange__8wxWindowCFi
;wxWindow::DoSetSize(int,int,int,int,int)
GetTitle__8wxWindowCFv
;wxWindow::GetCharHeight() const
GetCharHeight__8wxWindowCFv
- ;wxWindow::CreateKeyEvent(int,int,void*) const
- CreateKeyEvent__8wxWindowCFiT1Pv
;wxWindow::OS2Command(unsigned int,unsigned short)
OS2Command__8wxWindowFUiUs
wxWndProc
HandleActivate__8wxWindowFiUl
;wxWindow::FindItemByHWND(unsigned long,unsigned long) const
FindItemByHWND__8wxWindowCFUlT1
+ ;wxWindow::HandleKeyUp(void*,void*)
+ HandleKeyUp__8wxWindowFPvT1
;wxWindow::HandleChar(unsigned long,void*,unsigned long)
HandleChar__8wxWindowFUlPvT1
;wxWindow::DoMoveWindow(int,int,int,int)