bool Create( wxWindow* pParent
,int nFlags = wxBORDER_NONE
);
+ //
+ // Implementation only from now on
+ // -------------------------------
+ //
+
+ //
+ // Override Show() to prevent wxPopupWindow from being activated
+ //
+ virtual bool Show(bool show = TRUE);
+
+ //
+ // Find a shown popup window with the given window as parent, return NULL
+ // if none
+ //
+ static wxPopupWindow *FindPopupFor(wxWindow* pWin);
+
protected:
virtual void DoGetPosition( int* pnX
,int* pny
virtual WXDWORD OS2GetStyle( long lFlags
,WXDWORD* dwExstyle
) const;
+ //
+ // The list of all currently shown popup windows used by FindPopupFor()
+ //
+ static wxWindowList m_svShownPopups;
+
DECLARE_DYNAMIC_CLASS(wxPopupWindow)
}; // end of CLASS wxPopupWindow
virtual WXDWORD OS2GetStyle( long lFlag
,WXDWORD* pdwExstyle
) const;
+
+ //
+ // Choose the right parent to use with CreateWindow()
+ //
+ virtual WXHWND OS2GetParent(void) const;
+
//
// Is the frame currently iconized?
//
SWP m_vSwp;
SWP m_vSwpClient;
static bool m_sbInitialized;
+ static wxWindow* m_spHiddenParent;
}; // end of CLASS wxTopLevelWindowOS2
//
{ return OS2GetStyle(GetWindowStyle(), pdwExflags); }
+ // get the HWND to be used as parent of this window with CreateWindow()
+ virtual WXHWND OS2GetParent(void) const;
+
// returns TRUE if the window has been created
bool OS2Create( PSZ zClass
,const char* zTitle
#include "wx/popupwin.h"
+wxWindowList wxPopupWindow::m_svShownPopups;
+
// ============================================================================
// implementation
// ============================================================================
return dwStyle;
} // end of wxPopupWindow::OS2GetStyle
+bool wxPopupWindow::Show(
+ bool bShow
+)
+{
+ SWP vSwp;
+ //
+ // Skip wxWindow::Show() which calls wxBringWindowToTop(): this results in
+ // activating the popup window and stealing the atcivation from our parent
+ // which means that the parent frame becomes deactivated when opening a
+ // combobox, for example -- definitely not what we want
+ //
+ if (!wxWindowBase::Show(bShow))
+ return FALSE;
+
+ if (bShow)
+ {
+ m_svShownPopups.Append(this);
+ }
+ else // remove from the shown list
+ {
+ m_svShownPopups.DeleteObject(this);
+ }
+ ::WinQueryWindowPos(GetHwnd(), &vSwp);
+
+ if (bShow)
+ {
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_TOP
+ ,vSwp.x
+ ,vSwp.y
+ ,vSwp.cx
+ ,vSwp.cy
+ ,SWP_DEACTIVATE | SWP_SHOW | SWP_ZORDER
+ );
+ }
+ else
+ {
+ ::WinSetWindowPos( GetHwnd()
+ ,HWND_BOTTOM
+ ,vSwp.x
+ ,vSwp.y
+ ,vSwp.cx
+ ,vSwp.cy
+ ,SWP_HIDE | SWP_ZORDER
+ );
+ }
+ return TRUE;
+} // end of wxPopupWindow::Show
+
+/* static */
+wxPopupWindow* wxPopupWindow::FindPopupFor(
+ wxWindow* pWinParent
+)
+{
+ //
+ // Find a popup with the given parent in the linked list of all shown
+ // popups
+ //
+ for ( wxWindowList::Node *node = m_svShownPopups.GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow* pWin = node->GetData();
+
+ if (pWin->GetParent() == pWinParent )
+ return (wxPopupWindow *)pWin;
+ }
+ return NULL;
+} // end of wxPopupWindow::FindPopupFor
+
};
#define M_REGION (((wxRegionRefData*)m_refData)->m_hRegion)
+#define M_REGION_OF(rgn) (((wxRegionRefData*)(rgn.m_refData))->m_hRegion)
//-----------------------------------------------------------------------------
// wxRegion
, wxRegionOp eOp
)
{
- AllocExclusive();
-
- //
- // If ref count is 1, that means it's 'ours' anyway so no action.
- //
- RECTL vRect;
-
- vRect.xLeft = x;
- vRect.xRight = x + vWidth;
- vRect.yBottom = y;
- vRect.yTop = y + vHeight;
-
- HRGN hRgn = ::GpiCreateRegion( ((wxRegionRefData*)m_refData)->m_hPS
- ,1
- ,&vRect
- );
- LONG lMode = 0L;
-
- switch (eOp)
- {
- case wxRGN_AND:
- lMode = CRGN_AND;
- break;
-
- case wxRGN_OR:
- lMode = CRGN_OR;
- break;
-
- case wxRGN_XOR:
- lMode = CRGN_XOR;
- break;
-
- case wxRGN_DIFF:
- lMode = CRGN_DIFF;
- break;
-
- case wxRGN_COPY:
- default:
- lMode = CRGN_COPY;
- break;
- }
- bool bSuccess = ::GpiCombineRegion( ((wxRegionRefData*)m_refData)->m_hPS
- ,M_REGION
- ,M_REGION
- ,hRgn
- ,lMode
- );
- ::GpiDestroyRegion ( ((wxRegionRefData*)m_refData)->m_hPS
- ,hRgn
- );
-
- return bSuccess;
+ return Combine(wxRegion(x, y, vWidth, vHeight), eOp);
} // end of wxRegion::Combine
//
, wxRegionOp eOp
)
{
- if (rRegion.Empty())
- return FALSE;
-
- AllocExclusive();
+ //
+ // We can't use the API functions if we don't have a valid region handle
+ //
+ if (!m_refData)
+ {
+ // combining with an empty/invalid region works differently depending
+ // on the operation
+ switch (eOp)
+ {
+ case wxRGN_COPY:
+ case wxRGN_OR:
+ case wxRGN_XOR:
+ *this = rRegion;
+ break;
+
+ default:
+ wxFAIL_MSG( _T("unknown region operation") );
+ // fall through
+
+ case wxRGN_AND:
+ case wxRGN_DIFF:
+ // leave empty/invalid
+ return FALSE;
+ }
+ }
+ else // we have a valid region
+ {
- LONG lMode = 0;
+ LONG lMode = 0;
- switch (eOp)
- {
- case wxRGN_AND:
- lMode = CRGN_AND;
- break;
-
- case wxRGN_OR:
- lMode = CRGN_OR;
- break;
-
- case wxRGN_XOR:
- lMode = CRGN_XOR;
- break;
-
- case wxRGN_DIFF:
- lMode = CRGN_DIFF;
- break;
-
- case wxRGN_COPY:
- default:
- lMode = CRGN_COPY;
- break;
+ switch (eOp)
+ {
+ case wxRGN_AND:
+ lMode = CRGN_AND;
+ break;
+
+ case wxRGN_OR:
+ lMode = CRGN_OR;
+ break;
+
+ case wxRGN_XOR:
+ lMode = CRGN_XOR;
+ break;
+
+ case wxRGN_DIFF:
+ lMode = CRGN_DIFF;
+ break;
+
+ case wxRGN_COPY:
+ default:
+ lMode = CRGN_COPY;
+ break;
+ }
+ return (::GpiCombineRegion( ((wxRegionRefData*)rRegion.m_refData)->m_hPS
+ ,M_REGION
+ ,M_REGION
+ ,((wxRegionRefData*)rRegion.m_refData)->m_hRegion
+ ,lMode
+ ) != RGN_ERROR);
}
- return (::GpiCombineRegion( ((wxRegionRefData*)rRegion.m_refData)->m_hPS
- ,M_REGION
- ,M_REGION
- ,((wxRegionRefData*)rRegion.m_refData)->m_hRegion
- ,lMode
- ) != RGN_ERROR);
+ return TRUE;
} // end of wxRegion::Combine
bool wxRegion::Combine(
,wxWindowOS2* pWin
);
bool wxTopLevelWindowOS2::m_sbInitialized = FALSE;
+wxWindow* wxTopLevelWindowOS2::m_spHiddenParent = NULL;
// ============================================================================
// wxTopLevelWindowMSW implementation
return lMsflags;
} // end of wxTopLevelWindowOS2::OS2GetCreateWindowFlags
+WXHWND wxTopLevelWindowOS2::OS2GetParent() const
+{
+ //
+ // For the frames without wxFRAME_FLOAT_ON_PARENT style we should use NULL
+ // parent HWND or it would be always on top of its parent which is not what
+ // we usually want (in fact, we only want it for frames with the
+ // wxFRAME_FLOAT_ON_PARENT flag)
+ //
+ wxWindow* pParent;
+
+ if (HasFlag(wxFRAME_FLOAT_ON_PARENT) )
+ {
+ pParent = GetParent();
+
+ // this flag doesn't make sense then and will be ignored
+ wxASSERT_MSG( pParent,
+ _T("wxFRAME_FLOAT_ON_PARENT but no parent?") );
+ }
+ else // don't float on parent, must not be owned
+ {
+ pParent = NULL;
+ }
+ if (HasFlag(wxFRAME_NO_TASKBAR) && !pParent)
+ {
+ if (!m_spHiddenParent)
+ {
+ m_spHiddenParent = new wxTopLevelWindowOS2(NULL, -1, _T(""));
+
+ //
+ // We shouldn't leave it in wxTopLevelWindows or we wouldn't
+ // terminate the app when the last user-created frame is deleted --
+ // see ~wxTopLevelWindowMSW
+ //
+ wxTopLevelWindows.DeleteObject(m_spHiddenParent);
+ }
+ pParent = m_spHiddenParent;
+ }
+ return pParent ? pParent->GetHWND() : NULL;
+} // end of wxTopLevelWindowOS2::OS2GetParent
+
bool wxTopLevelWindowOS2::CreateDialog(
ULONG ulDlgTemplate
, const wxString& rsTitle
return bNonDefault;
} // end of wxWindowOS2::OS2GetCreateWindowCoords
+WXHWND wxWindowOS2::OS2GetParent() const
+{
+ return m_parent ? m_parent->GetHWND() : NULL;
+}
+
bool wxWindowOS2::OS2Create(
PSZ zClass
, const char* zTitle
,nHeight
);
- if (GetWindowStyleFlag() & wxPOPUP_WINDOW)
- hParent = HWND_DESKTOP;
- else
- {
- if ((bIsChild || HasFlag(wxFRAME_TOOL_WINDOW)) && pParent )
- {
- //
- // This is either a normal child window or a top level window with
- // wxFRAME_TOOL_WINDOW style (see below)
- //
- hParent = GetHwndOf(pParent);
- }
- else
- {
- //
- // This is either a window for which no parent was specified (not
- // much we can do then) or a frame without wxFRAME_TOOL_WINDOW
- // style: we should use NULL parent HWND for it or it would be
- // always on top of its parent which is not what we usually want
- // (in fact, we only want it for frames with the special
- // wxFRAME_TOOL_WINDOW as above)
- //
- hParent = NULL;
- }
- }
if (bIsChild)
{
lControlId = GetId();
{
sClassName += wxT("NR");
}
- m_hWnd = (WXHWND)::WinCreateWindow( (HWND)hParent
- ,(PSZ)sClassName.c_str()
- ,(PSZ)zTitle ? zTitle : ""
- ,(ULONG)dwStyle
- ,(LONG)0L
- ,(LONG)0L
- ,(LONG)0L
- ,(LONG)0L
- ,NULLHANDLE
- ,HWND_TOP
- ,(ULONG)lControlId
- ,pCtlData
- ,NULL
- );
+ m_hWnd = (WXHWND)::WinCreateWindow( (HWND)OS2GetParent()
+ ,(PSZ)sClassName.c_str()
+ ,(PSZ)zTitle ? zTitle : ""
+ ,(ULONG)dwStyle
+ ,(LONG)0L
+ ,(LONG)0L
+ ,(LONG)0L
+ ,(LONG)0L
+ ,NULLHANDLE
+ ,HWND_TOP
+ ,(ULONG)lControlId
+ ,pCtlData
+ ,NULL
+ );
if (!m_hWnd)
{
vError = ::WinGetLastError(wxGetInstance());
rEvent.m_rightDown = ((uFlags & VK_BUTTON2) != 0);
rEvent.SetTimestamp(s_currentMsg.time);
rEvent.m_eventObject = this;
+ rEvent.SetId(GetId());
#if wxUSE_MOUSEEVENT_HACK
m_lastMouseX = nX;
CODE LOADONCALL
EXPORTS
-;From library: F:\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
__ct__21wxPageSetupDialogDataFRC11wxPrintData
;wxPageSetupDialogData::operator=(const wxPageSetupDialogData&)
__as__21wxPageSetupDialogDataFRC21wxPageSetupDialogData
- ;wxPrintData::wxPrintData()
- __ct__11wxPrintDataFv
+ ;wxFontDialogBase::~wxFontDialogBase()
+ __dt__16wxFontDialogBaseFv
;wxConstructorForwxPageSetupDialogData()
wxConstructorForwxPageSetupDialogData__Fv
;wxPrintDialogData::~wxPrintDialogData()
__dt__17wxPrintDialogDataFv
- ;wxFontDialogBase::~wxFontDialogBase()
- __dt__16wxFontDialogBaseFv
;wxColourData::wxColourData()
__ct__12wxColourDataFv
+ ;wxPrintData::wxPrintData()
+ __ct__11wxPrintDataFv
;wxPageSetupDialogData::CalculatePaperSizeFromId()
CalculatePaperSizeFromId__21wxPageSetupDialogDataFv
;wxPageSetupDialogData::CalculateIdFromPaperSize()
wxEVT_KILL_FOCUS
wxEVT_COMMAND_RIGHT_DCLICK
wxEVT_CLOSE_WINDOW
- ;wxEvtHandler::ProcessEvent(wxEvent&)
- ProcessEvent__12wxEvtHandlerFR7wxEvent
+ ;wxMouseEvent::Assign(const wxMouseEvent&)
+ Assign__12wxMouseEventFRC12wxMouseEvent
wxEVT_SCROLL_LINEUP
wxEVT_PAINT
wxEVT_NULL
sm_classwxEraseEvent__12wxEraseEvent
;wxEvtHandler::SearchEventTable(wxEventTable&,wxEvent&)
SearchEventTable__12wxEvtHandlerFR12wxEventTableR7wxEvent
+ ;wxEvtHandler::ProcessEvent(wxEvent&)
+ ProcessEvent__12wxEvtHandlerFR7wxEvent
;wxMouseEvent::wxMouseEvent(int)
__ct__12wxMouseEventFi
wxEVT_JOY_ZMOVE
wxEVT_NC_LEFT_DCLICK
wxEVT_INIT_DIALOG
wxEVT_COMMAND_SET_FOCUS
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c
;PUBDEFs (Symbols available from object file):
ConvertToIeeeExtended
ConvertFromIeeeExtended
GetImageCount__7wxImageFR13wxInputStreaml
;wxImage::FindFirstUnusedColour(unsigned char*,unsigned char*,unsigned char*,unsigned char,unsigned char,unsigned char) const
FindFirstUnusedColour__7wxImageCFPUcN21UcN24
- ;wxImage::Scale(int,int) const
- Scale__7wxImageCFiT1
+ ;wxImageHandler::CallDoCanRead(wxInputStream&)
+ CallDoCanRead__14wxImageHandlerFR13wxInputStream
;wxImage::sm_handlers
sm_handlers__7wxImage
;wxImage::wxImage(const wxImage&)
__ct__7wxImageFR13wxInputStreamRC8wxStringi
;wxImage::SetPalette(const wxPalette&)
SetPalette__7wxImageFRC9wxPalette
+ ;wxImage::Scale(int,int) const
+ Scale__7wxImageCFiT1
;wxImage::LoadFile(const wxString&,long,int)
LoadFile__7wxImageFRC8wxStringli
;wxImageHandler::LoadFile(wxImage*,wxInputStream&,unsigned long,int)
Read32__17wxTextInputStreamFv
;wxTextInputStream::SkipIfEndOfLine(char)
SkipIfEndOfLine__17wxTextInputStreamFc
- ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
+ ;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c
;PUBDEFs (Symbols available from object file):
unzReadCurrentFile
unzGetCurrentFileInfo
GetHelpText__12wxWindowBaseCFv
;wxWindowBase::GetAncestorWithCustomPalette() const
GetAncestorWithCustomPalette__12wxWindowBaseCFv
+ ;wxWindowBase::FindWindowByLabel(const wxString&,const wxWindow*)
+ FindWindowByLabel__12wxWindowBaseFRC8wxStringPC8wxWindow
+ ;wxWindowBase::FindWindowByName(const wxString&,const wxWindow*)
+ FindWindowByName__12wxWindowBaseFRC8wxStringPC8wxWindow
+ ;wxWindowBase::FindWindowById(long,const wxWindow*)
+ FindWindowById__12wxWindowBaseFlPC8wxWindow
;wxWindowBase::SetFont(const wxFont&)
SetFont__12wxWindowBaseFRC6wxFont
;wxWindowBase::MakeModal(unsigned long)
InitBase__12wxWindowBaseFv
;wxWindowBase::SetCursor(const wxCursor&)
SetCursor__12wxWindowBaseFRC8wxCursor
+ ;wxWindowBase::SatisfyConstraints()
+ SatisfyConstraints__12wxWindowBaseFv
;wxWindowBase::ResetConstraints()
ResetConstraints__12wxWindowBaseFv
;wxWindowBase::GetDefaultBorder() const
WriteCustomization__15wxHtmlHelpFrameFP12wxConfigBaseRC8wxString
;wxHtmlHelpFrameOptionsDialog::sm_eventTable
sm_eventTable__28wxHtmlHelpFrameOptionsDialog
- ;wxHtmlHelpFrame::OnIndexAll(wxCommandEvent&)
- OnIndexAll__15wxHtmlHelpFrameFR14wxCommandEvent
+ ;wxHtmlHelpFrame::OnActivate(wxActivateEvent&)
+ OnActivate__15wxHtmlHelpFrameFR15wxActivateEvent
__vft28wxHtmlHelpFrameOptionsDialog8wxObject
__vft15wxHtmlHelpFrame8wxObject
+ ;wxHtmlHelpFrame::OnIndexAll(wxCommandEvent&)
+ OnIndexAll__15wxHtmlHelpFrameFR14wxCommandEvent
;wxHtmlHelpFrame::wxHtmlHelpFrame(wxWindow*,int,const wxString&,int,wxHtmlHelpData*)
__ct__15wxHtmlHelpFrameFP8wxWindowiRC8wxStringT2P14wxHtmlHelpData
;wxHtmlHelpFrame::DisplayContents()
__vft13wxPopupWindow8wxObject
;wxPopupWindow::DoGetPosition(int*,int*) const
DoGetPosition__13wxPopupWindowCFPiT1
+ ;wxPopupWindow::FindPopupFor(wxWindow*)
+ FindPopupFor__13wxPopupWindowFP8wxWindow
+ ;wxPopupWindow::Show(unsigned long)
+ Show__13wxPopupWindowFUl
+ ;wxPopupWindow::m_svShownPopups
+ m_svShownPopups__13wxPopupWindow
;wxPopupWindow::OS2GetStyle(long,unsigned long*) const
OS2GetStyle__13wxPopupWindowCFlPUl
;wxPopupWindow::Create(wxWindow*,int)
Init__19wxTopLevelWindowOS2Fv
;wxTopLevelWindowOS2::m_sbInitialized
m_sbInitialized__19wxTopLevelWindowOS2
+ ;wxTopLevelWindowOS2::OS2GetParent() const
+ OS2GetParent__19wxTopLevelWindowOS2CFv
;wxTopLevelWindowOS2::Iconize(unsigned long)
Iconize__19wxTopLevelWindowOS2FUl
;wxTopLevelWindowOS2::DoSetClientSize(int,int)
DoSetClientSize__19wxTopLevelWindowOS2FiT1
;wxTopLevelWindowOS2::IsMaximized() const
IsMaximized__19wxTopLevelWindowOS2CFv
+ ;wxTopLevelWindowOS2::m_spHiddenParent
+ m_spHiddenParent__19wxTopLevelWindowOS2
;wxTopLevelWindowOS2::SetIcon(const wxIcon&)
SetIcon__19wxTopLevelWindowOS2FRC6wxIcon
;wxTopLevelWindowOS2::Restore()
UnsubclassWin__8wxWindowFv
;wxWindow::Raise()
Raise__8wxWindowFv
+ ;wxWindow::OS2GetParent() const
+ OS2GetParent__8wxWindowCFv
;wxWindow::Lower()
Lower__8wxWindowFv
;wxWindow::HandleMaximize()