diff --git a/src/os2/app.cpp b/src/os2/app.cpp index 31c1d49629..1024579bb0 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -965,19 +965,20 @@ bool wxApp::ProcessMessage( return FALSE; } // end of wxApp::ProcessMessage +bool gbInOnIdle = FALSE; + void wxApp::OnIdle( wxIdleEvent& rEvent ) { - static bool sbInOnIdle = FALSE; // // Avoid recursion (via ProcessEvent default case) // - if (sbInOnIdle) + if (gbInOnIdle) return; - sbInOnIdle = TRUE; + gbInOnIdle = TRUE; // // If there are pending events, we must process them: pending events @@ -1019,7 +1020,7 @@ void wxApp::OnIdle( // rEvent.RequestMore(TRUE); } - sbInOnIdle = FALSE; + gbInOnIdle = FALSE; } // end of wxApp::OnIdle // Send idle event to all top-level windows diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index eb635379c9..1ab046a28e 100644 --- a/src/os2/dialog.cpp +++ b/src/os2/dialog.cpp @@ -206,6 +206,15 @@ void wxDialog::DoShowModal() // ::WinProcessDlg((HWND)GetHwnd()); + // + // Before entering the modal loop, reset the "is in OnIdle()" flag (see + // comment in app.cpp) + // + extern bool gbInOnIdle; + bool bWasInOnIdle = gbInOnIdle; + + gbInOnIdle = FALSE; + // // Enter the modal loop // @@ -221,6 +230,7 @@ void wxDialog::DoShowModal() // a message came or no more idle processing to do wxTheApp->DoMessage(); } + gbInOnIdle = bWasInOnIdle; // // Snd restore focus diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index 0b8784621c..7912d9c7e3 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -70,9 +70,23 @@ bool wxRadioButton::Create( ,rsName)) return FALSE; - long lSstyle = HasFlag(wxRB_GROUP) ? WS_GROUP : 0; + long lSstyle = WS_TABSTOP; - lSstyle |= BS_AUTORADIOBUTTON; + if (HasFlag(wxRB_GROUP)) + lSstyle |= WS_GROUP; + + // + // wxRB_SINGLE is a temporary workaround for the following problem: if you + // have 2 radiobuttons in the same group but which are not consecutive in + // the dialog, Windows can enter an infinite loop! The simplest way to + // reproduce it is to create radio button, then a panel and then another + // radio button: then checking the last button hangs the app. + // + // Ideally, we'd detect (and avoid) such situation automatically but for + // now, as I don't know how to do it, just allow the user to create + // BS_RADIOBUTTON buttons for such situations. + // + lSstyle |= HasFlag(wxRB_SINGLE) ? BS_RADIOBUTTON : BS_AUTORADIOBUTTON; if (HasFlag(wxCLIP_SIBLINGS)) lSstyle |= WS_CLIPSIBLINGS; @@ -148,18 +162,38 @@ bool wxRadioButton::OS2Command( , WXWORD wId ) { - if (wParam == BN_CLICKED) + if (wParam != BN_CLICKED) + return FALSE; + + if (m_bFocusJustSet) { + // + // See above: we want to ignore this event + // + m_bFocusJustSet = FALSE; + } + else + { + bool bIsChecked = GetValue(); + + if (HasFlag(wxRB_SINGLE)) + { + // + // When we use a "manual" radio button, we have to check the button + // ourselves -- but it's reset to unchecked state by the user code + // (presumably when another button is pressed) + // + if (!bIsChecked ) + SetValue(TRUE); + } wxCommandEvent rEvent( wxEVT_COMMAND_RADIOBUTTON_SELECTED ,m_windowId ); rEvent.SetEventObject(this); ProcessCommand(rEvent); - return TRUE; } - else - return FALSE; + return TRUE; } // end of wxRadioButton::OS2Command void wxRadioButton::SetFocus() diff --git a/src/os2/window.cpp b/src/os2/window.cpp index d88927fcae..4ab8890da9 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -2427,6 +2427,14 @@ bool wxWindowOS2::OS2ProcessMessage( pBtn->OS2Command(BN_CLICKED, 0 /* unused */); return TRUE; } + else if (!IsTopLevel()) + { + // + // if not a top level window, let parent + // handle it + // + return FALSE; + } // else: but if it does not it makes sense to make // it work like a TAB - and that's what we do. // Note that Ctrl-Enter always works this way. diff --git a/src/os2/wx23.def b/src/os2/wx23.def index 7da5b841f2..c902a521a0 100644 --- a/src/os2/wx23.def +++ b/src/os2/wx23.def @@ -608,10 +608,12 @@ EXPORTS DoEmpty__15wxDateTimeArrayFv ;wxDateTime::Add(const wxTimeSpan&) const Add__10wxDateTimeCFRC10wxTimeSpan - ;wxDateTime::SetMinute(unsigned short) - SetMinute__10wxDateTimeFUs + ;wxDateTime::SetToWeekDayInSameWeek(wxDateTime::WeekDay,wxDateTime::WeekFlags) + SetToWeekDayInSameWeek__10wxDateTimeFQ2_10wxDateTime7WeekDayQ2_10wxDateTime9WeekFlags ;wxDateTime::SetSecond(unsigned short) SetSecond__10wxDateTimeFUs + ;wxDateTime::SetMinute(unsigned short) + SetMinute__10wxDateTimeFUs ;wxDateTime::MakeTimezone(const wxDateTime::TimeZone&,unsigned long) MakeTimezone__10wxDateTimeFRCQ2_10wxDateTime8TimeZoneUl ;wxTimeSpan::wxTimeSpan(long,long,long,long) @@ -648,10 +650,12 @@ EXPORTS GetCurrentYear__10wxDateTimeFQ2_10wxDateTime8Calendar ;wxDateSpan::Add(const wxDateSpan&) Add__10wxDateSpanFRC10wxDateSpan - ;wxDateTime::SetDay(unsigned short) - SetDay__10wxDateTimeFUs + ;wxDateTime::SetToTheWeek(unsigned short,wxDateTime::WeekDay,wxDateTime::WeekFlags) + SetToTheWeek__10wxDateTimeFUsQ2_10wxDateTime7WeekDayQ2_10wxDateTime9WeekFlags ;wxDateTime::SetHour(unsigned short) SetHour__10wxDateTimeFUs + ;wxDateTime::SetDay(unsigned short) + SetDay__10wxDateTimeFUs ;wxDateTime::wxDateTime(long) __ct__10wxDateTimeFl ;wxDateTime::Set(double) @@ -684,8 +688,6 @@ EXPORTS IsEqualTo__10wxDateTimeCFRC10wxDateTime ;wxDateTime::IsBetween(const wxDateTime&,const wxDateTime&) const IsBetween__10wxDateTimeCFRC10wxDateTimeT1 - ;wxDateTime::GetWeek(unsigned short,wxDateTime::WeekDay) const - GetWeek__10wxDateTimeCFUsQ2_10wxDateTime7WeekDay ;wxDateTime::GetLastWeekDay(wxDateTime::WeekDay,wxDateTime::Month,int) GetLastWeekDay__10wxDateTimeFQ2_10wxDateTime7WeekDayQ2_10wxDateTime5Monthi ;wxDateTime::GetEndDST(int,wxDateTime::Country) @@ -733,10 +735,6 @@ EXPORTS TIME_T_FACTOR__10wxDateTime ;wxDateTime::Subtract(const wxDateTime&) const Subtract__10wxDateTimeCFRC10wxDateTime - ;wxDateTime::SetToWeekDayInSameWeek(wxDateTime::WeekDay) - SetToWeekDayInSameWeek__10wxDateTimeFQ2_10wxDateTime7WeekDay - ;wxDateTime::SetToTheWeek(unsigned short,wxDateTime::WeekDay) - SetToTheWeek__10wxDateTimeFUsQ2_10wxDateTime7WeekDay ;wxDateTime::SetToPrevWeekDay(wxDateTime::WeekDay) SetToPrevWeekDay__10wxDateTimeFQ2_10wxDateTime7WeekDay ;wxDateTime::IsSameTime(const wxDateTime&) const @@ -777,8 +775,8 @@ EXPORTS Add__10wxDateTimeFRC10wxTimeSpan ;wxDateTime::Add(const wxDateSpan&) const Add__10wxDateTimeCFRC10wxDateSpan - ;wxDateTime::GetMonthName(wxDateTime::Month,wxDateTime::NameFlags) - GetMonthName__10wxDateTimeFQ2_10wxDateTime5MonthQ2_10wxDateTime9NameFlags + ;wxDateTime::GetWeek(unsigned short,wxDateTime::WeekDay,wxDateTime::WeekFlags) const + GetWeek__10wxDateTimeCFUsQ2_10wxDateTime7WeekDayQ2_10wxDateTime9WeekFlags ;wxDateTime::SetMillisecond(unsigned short) SetMillisecond__10wxDateTimeFUs ;wxDateTime::ParseDate(const char*) @@ -787,6 +785,8 @@ EXPORTS ParseDateTime__10wxDateTimeFPCc ;wxDateTime::GetWeekDayName(wxDateTime::WeekDay,wxDateTime::NameFlags) GetWeekDayName__10wxDateTimeFQ2_10wxDateTime7WeekDayQ2_10wxDateTime9NameFlags + ;wxDateTime::GetMonthName(wxDateTime::Month,wxDateTime::NameFlags) + GetMonthName__10wxDateTimeFQ2_10wxDateTime5MonthQ2_10wxDateTime9NameFlags ;wxDateTime::Set(long) Set__10wxDateTimeFl ;wxDateTime::ToTimezone(const wxDateTime::TimeZone&,unsigned long) const @@ -810,8 +810,6 @@ EXPORTS IsEarlierThan__10wxDateTimeCFRC10wxDateTime ;wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags,const wxDateTime::TimeZone&) const GetWeekOfMonth__10wxDateTimeCFQ2_10wxDateTime9WeekFlagsRCQ2_10wxDateTime8TimeZone - ;wxDateTime::GetWeekDayInSameWeek(wxDateTime::WeekDay) const - GetWeekDayInSameWeek__10wxDateTimeCFQ2_10wxDateTime7WeekDay ;wxDateTimeArray::DoCopy(const wxDateTimeArray&) DoCopy__15wxDateTimeArrayFRC15wxDateTimeArray ;wxDateTime::IsInStdRange() const @@ -844,10 +842,12 @@ EXPORTS Add__10wxDateTimeFRC10wxDateSpan ;wxTimeSpan::Abs() const Abs__10wxTimeSpanCFv - ;wxDateTime::GetYearDay(unsigned short) const - GetYearDay__10wxDateTimeCFUs + ;wxDateTime::GetWeekDayInSameWeek(wxDateTime::WeekDay,wxDateTime::WeekFlags) const + GetWeekDayInSameWeek__10wxDateTimeCFQ2_10wxDateTime7WeekDayQ2_10wxDateTime9WeekFlags ;wxDateTime::SetToYearDay(unsigned short) SetToYearDay__10wxDateTimeFUs + ;wxDateTime::GetYearDay(unsigned short) const + GetYearDay__10wxDateTimeCFUs ;wxTimeSpan::Format(const char*) const Format__10wxTimeSpanCFPCc ;From object file: ..\common\datstrm.cpp @@ -5125,9 +5125,11 @@ EXPORTS SetScreenType__16wxSystemSettingsF18wxSystemScreenType ;From object file: ..\common\sizer.cpp ;PUBDEFs (Symbols available from object file): + ;wxSizer::Show(wxSizer*,unsigned long) + Show__7wxSizerFP7wxSizerUl + __vft11wxGridSizer8wxObject ;wxSizerItem::wxSizerItem(int,int,int,int,int,wxObject*) __ct__11wxSizerItemFiN41P8wxObject - __vft11wxGridSizer8wxObject ;wxSizerItem::wxSizerItem(wxSizer*,int,int,int,wxObject*) __ct__11wxSizerItemFP7wxSizeriN22P8wxObject ;wxSizer::Insert(int,wxSizer*,int,int,int,wxObject*) @@ -5198,6 +5200,8 @@ EXPORTS RecalcSizes__16wxStaticBoxSizerFv ;wxSizerItem::IsWindow() IsWindow__11wxSizerItemFv + ;wxSizer::IsShown(wxSizer*) + IsShown__7wxSizerFP7wxSizer ;wxSizerItem::GetSize() GetSize__11wxSizerItemFv ;wxNotebookSizer::CalcMin() @@ -5208,10 +5212,14 @@ EXPORTS Remove__7wxSizerFP8wxWindow ;wxSizer::FitSize(wxWindow*) FitSize__7wxSizerFP8wxWindow - ;wxSizer::Clear(unsigned long) - Clear__7wxSizerFUl + ;wxSizer::Show(wxWindow*,unsigned long) + Show__7wxSizerFP8wxWindowUl __vft7wxSizer8wxObject __vft15wxNotebookSizer8wxObject + ;wxSizer::ShowItems(unsigned long) + ShowItems__7wxSizerFUl + ;wxSizer::Clear(unsigned long) + Clear__7wxSizerFUl ;wxSizer::Remove(int) Remove__7wxSizerFi ;wxSizer::GetMinSize() @@ -5258,6 +5266,8 @@ EXPORTS DeleteWindows__11wxSizerItemFv ;wxSizer::GetMinClientSize(wxWindow*) GetMinClientSize__7wxSizerFP8wxWindow + ;wxSizer::IsShown(wxWindow*) + IsShown__7wxSizerFP8wxWindow ;wxSizer::GetMaxClientSize(wxWindow*) GetMaxClientSize__7wxSizerFP8wxWindow ;wxSizerItem::wxSizerItem(wxWindow*,int,int,int,wxObject*) @@ -7531,6 +7541,8 @@ EXPORTS HitTest__14wxCalendarCtrlFRC7wxPointP10wxDateTimePQ2_10wxDateTime7WeekDay ;wxCalendarCtrl::DoGetPosition(int*,int*) const DoGetPosition__14wxCalendarCtrlCFPiT1 + ;wxCalendarCtrl::wxCalendarCtrl(wxWindow*,int,const wxDateTime&,const wxPoint&,const wxSize&,long,const wxString&) + __ct__14wxCalendarCtrlFP8wxWindowiRC10wxDateTimeRC7wxPointRC6wxSizelRC8wxString ;wxCalendarCtrl::Enable(unsigned long) Enable__14wxCalendarCtrlFUl wxEVT_CALENDAR_WEEKDAY_CLICKED @@ -9898,6 +9910,8 @@ EXPORTS GetEventTable__23wxGenericMDIParentFrameCFv ;wxGenericMDIParentFrame::GetClientWindow() const GetClientWindow__23wxGenericMDIParentFrameCFv + ;wxMDIParentFrame::GetActiveChild() const + GetActiveChild__16wxMDIParentFrameCFv ;wxGenericMDIChildFrame::Create(wxGenericMDIParentFrame*,int,const wxString&,const wxPoint&,const wxSize&,long,const wxString&) Create__22wxGenericMDIChildFrameFP23wxGenericMDIParentFrameiRC8wxStringRC7wxPointRC6wxSizelT3 ;wxGenericMDIChildFrame::OnMenuHighlight(wxMenuEvent&) @@ -11734,6 +11748,7 @@ EXPORTS sm_classwxApp__5wxApp ;wxAppRemoveSocketHandler(int) wxAppRemoveSocketHandler__Fi + gbInOnIdle ;wxAppAddSocketHandler(int,int,void(*)(void*),void*) wxAppAddSocketHandler__FiT1PFPv_vPv ;wxWakeUpIdle()