From: David Webster Date: Fri, 30 Aug 2002 21:54:47 +0000 (+0000) Subject: Weekly updates X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cfcebdb1bba3369205b6693f2593f74394354edd?ds=inline Weekly updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 46892a89fc..4475844729 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -234,9 +234,13 @@ void wxButton::SetDefault() // Set this one as the default button both for wxWindows and Windows // wxWindow* pWinOldDefault = pParent->SetDefaultItem(this); - UpdateDefaultStyle( this - ,pWinOldDefault - ); + + SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton) + ,FALSE + ); + SetDefaultStyle( this + ,TRUE + ); } // end of wxButton::SetDefault void wxButton::SetTmpDefault() @@ -246,14 +250,14 @@ void wxButton::SetTmpDefault() wxCHECK_RET( pParent, _T("button without parent?") ); wxWindow* pWinOldDefault = pParent->GetDefaultItem(); + pParent->SetTmpDefaultItem(this); - if (pWinOldDefault != this) - { - UpdateDefaultStyle( this - ,pWinOldDefault - ); - } - //else: no styles to update + SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton) + ,FALSE + ); + SetDefaultStyle( this + ,TRUE + ); } // end of wxButton::SetTmpDefault void wxButton::UnsetTmpDefault() @@ -266,47 +270,60 @@ void wxButton::UnsetTmpDefault() wxWindow* pWinOldDefault = pParent->GetDefaultItem(); - if (pWinOldDefault != this) - { - UpdateDefaultStyle( pWinOldDefault - ,this - ); - } - //else: we had been default before anyhow + SetDefaultStyle( this + ,FALSE + ); + SetDefaultStyle( wxDynamicCast(pWinOldDefault, wxButton) + ,TRUE + ); } // end of wxButton::UnsetTmpDefault -void wxButton::UpdateDefaultStyle( - wxWindow* pWinDefault -, wxWindow* pWinOldDefault) +void wxButton::SetDefaultStyle( + wxButton* pBtn +, bool bOn +) { - wxButton* pBtnOldDefault = wxDynamicCast(pWinOldDefault, wxButton); long lStyle; + // + // We may be called with NULL pointer -- simpler to do the check here than + // in the caller which does wxDynamicCast() + // + if (!pBtn) + return; - if ( pBtnOldDefault && pBtnOldDefault != pWinDefault ) + // + // First, let DefDlgProc() know about the new default button + // + if (bOn) + { + if (!wxTheApp->IsActive()) + return; + + // + // In OS/2 the dialog/panel doesn't really know it has a default + // button, the default button simply has that style. We'll just + // simulate by setting focus to it + // + pBtn->SetFocus(); + } + lStyle = ::WinQueryWindowULong(GetHwndOf(pBtn), QWL_STYLE); + if (!(lStyle & BS_DEFAULT) == bOn) { - lStyle = ::WinQueryWindowULong(GetHwndOf(pBtnOldDefault), QWL_STYLE); if ((lStyle & BS_USERBUTTON) != BS_USERBUTTON) { - lStyle &= ~BS_DEFAULT; - ::WinSetWindowULong(GetHwndOf(pBtnOldDefault), QWL_STYLE, lStyle); + if (bOn) + lStyle | BS_DEFAULT; + else + lStyle &= ~BS_DEFAULT; + ::WinSetWindowULong(GetHwndOf(pBtn), QWL_STYLE, lStyle); } else { - // redraw the button - it will notice itself that it's not the + // + // Redraw the button - it will notice itself that it's not the // default one any longer - pBtnOldDefault->Refresh(); - } - } - - wxButton* pBtnDefault = wxDynamicCast(pWinDefault, wxButton); - - if (pBtnDefault) - { - lStyle = ::WinQueryWindowULong(GetHwndOf(pBtnDefault), QWL_STYLE); - if ((lStyle & BS_USERBUTTON) != BS_USERBUTTON) - { - lStyle != BS_DEFAULT; - ::WinSetWindowULong(GetHwndOf(pBtnDefault), QWL_STYLE, lStyle); + // + pBtn->Refresh(); } } } // end of wxButton::UpdateDefaultStyle diff --git a/src/os2/choice.cpp b/src/os2/choice.cpp index a1cdd262b1..f3f95b2a91 100644 --- a/src/os2/choice.cpp +++ b/src/os2/choice.cpp @@ -212,7 +212,7 @@ wxString wxChoice::GetString( char* zBuf; nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0)); - if (nLen) + if (nLen != LIT_ERROR && nLen > 0) { zBuf = new char[nLen + 1]; ::WinSendMsg( GetHwnd() diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index 927325f758..651dfe9209 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -101,6 +101,7 @@ bool wxComboBox::Create( , const wxString& rsName ) { + m_isShown = FALSE; if (!CreateControl( pParent ,vId @@ -143,12 +144,7 @@ bool wxComboBox::Create( // SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - wxFont* pTextFont = new wxFont( 10 - ,wxMODERN - ,wxNORMAL - ,wxNORMAL - ); - SetFont(*pTextFont); + SetFont(*wxSMALL_FONT); int i; for (i = 0; i < n; i++) @@ -169,7 +165,7 @@ bool wxComboBox::Create( ,(PFNWP)wxComboEditWndProc ); ::WinSetWindowULong(GetHwnd(), QWL_USER, (ULONG)this); - delete pTextFont; + Show(TRUE); return TRUE; } // end of wxComboBox::Create diff --git a/src/os2/control.cpp b/src/os2/control.cpp index 6b4a38bc8b..a50497174d 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -117,7 +117,8 @@ bool wxControl::OS2CreateControl( // All controls should have these styles (wxWindows creates all controls // visible by default) // - dwStyle |= WS_VISIBLE; + if (m_isShown ) + dwStyle |= WS_VISIBLE; wxWindow* pParent = GetParent(); PSZ zClass; diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 056ce7bc74..0ca6894be9 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -1420,3 +1420,22 @@ wxWindow* wxFrame::GetClient() { return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT)); } + +void wxFrame::SendSizeEvent() +{ + if (!m_bIconized) + { + RECTL vRect = wxGetWindowRect(GetHwnd()); + + ::WinPostMsg( GetHwnd() + ,WM_SIZE + ,MPFROM2SHORT( vRect.xRight - vRect.xLeft + ,vRect.xRight - vRect.xLeft + ) + ,MPFROM2SHORT( vRect.yTop - vRect.yBottom + ,vRect.yTop - vRect.yBottom + ) + ); + } +} + diff --git a/src/os2/mimetype.cpp b/src/os2/mimetype.cpp index cd51d499dc..8ee7a32059 100644 --- a/src/os2/mimetype.cpp +++ b/src/os2/mimetype.cpp @@ -245,7 +245,7 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const return FALSE; } -bool wxFileTypeImpl::GetIcon(wxIcon *icon) const +bool wxFileTypeImpl::GetIcon(wxIcon *icon, wxString* psCommand, int* pnIndex) const { #if wxUSE_GUI if ( m_info ) { diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 2fa04e7049..d526cfa43f 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -488,4 +488,20 @@ bool wxSpinCtrl::Show( return TRUE; } // end of wxSpinCtrl::Show +void wxSpinCtrl::SetSelection ( + long lFrom +, long lTo +) +{ + // + // If from and to are both -1, it means (in wxWindows) that all text should + // be selected - translate into Windows convention + // + if ((lFrom == -1) && (lTo == -1)) + { + lFrom = 0; + } + ::WinSendMsg(m_hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lFrom, (USHORT)lTo), (MPARAM)0); +} // end of wxSpinCtrl::SetSelection + #endif //wxUSE_SPINBTN diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index a9e711e7b0..9d38365087 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -101,6 +101,7 @@ bool wxTextCtrl::Create( { HWND hParent; int nTempy; + // // Base initialization // diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 7e0ac7cb4e..6fc21ee0c3 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -302,6 +302,7 @@ void wxWindowOS2::Init() m_bMouseInWindow = FALSE; m_bLastKeydownProcessed = FALSE; m_bIsActivePage = TRUE; + m_pChildrenDisabled = NULL; // // wxWnd @@ -366,6 +367,7 @@ wxWindowOS2::~wxWindowOS2() // wxRemoveHandleAssociation(this); } + delete m_pChildrenDisabled; } // end of wxWindowOS2::~wxWindowOS2 // real construction (Init() must have been called before!) @@ -425,7 +427,7 @@ bool wxWindowOS2::Create( // set in those class create procs. PM's basic windows styles are // very limited. // - ulCreateFlags |= WS_VISIBLE | OS2GetCreateWindowFlags(&dwExStyle); + ulCreateFlags |= OS2GetCreateWindowFlags(&dwExStyle); #ifdef __WXUNIVERSAL__ @@ -434,11 +436,13 @@ bool wxWindowOS2::Create( #endif // !wxUniversal if (lStyle & wxPOPUP_WINDOW) { - // a popup window floats on top of everything - // it is also created hidden as other top level windows ulCreateFlags &= ~WS_VISIBLE; m_isShown = FALSE; } + else + { + ulCreateFlags |= WS_VISIBLE; + } // // Generic OS/2 Windows have no Control Data but other classes @@ -505,9 +509,44 @@ bool wxWindowOS2::Enable( { wxWindow* pChild = pNode->GetData(); - pChild->Enable(bEnable); + if (bEnable) + { + // + // Enable the child back unless it had been disabled before us + // + if (!m_pChildrenDisabled || !m_pChildrenDisabled->Find(pChild)) + pChild->Enable(); + } + else // we're being disabled + { + if (pChild->IsEnabled()) + { + // + // Disable it as children shouldn't stay enabled while the + // parent is not + // + pChild->Disable(); + } + else // child already disabled, remember it + { + // + // Have we created the list of disabled children already? + // + if (!m_pChildrenDisabled) + m_pChildrenDisabled = new wxWindowList; + m_pChildrenDisabled->Append(pChild); + } + } pNode = pNode->GetNext(); } + if (bEnable && m_pChildrenDisabled) + { + // + // We don't need this list any more, don't keep unused memory + // + delete m_pChildrenDisabled; + m_pChildrenDisabled = NULL; + } return TRUE; } // end of wxWindowOS2::Enable diff --git a/src/os2/wx23.def b/src/os2/wx23.def index 4c8cebe451..329b08b437 100644 --- a/src/os2/wx23.def +++ b/src/os2/wx23.def @@ -80,8 +80,8 @@ EXPORTS __ct__9wxAppBaseFv ;wxAppBase::OnInit() OnInit__9wxAppBaseFv - ;wxAppBase::DoInit() - DoInit__9wxAppBaseFv + ;wxAppBase::CreateMessageOutput() + CreateMessageOutput__9wxAppBaseFv ;wxOnAssert(const char*,int,const char*,const char*) wxOnAssert__FPCciN21 ;wxAppBase::~wxAppBase() @@ -90,6 +90,8 @@ EXPORTS ProcessPendingEvents__9wxAppBaseFv ;wxAppBase::OnCmdLineError(wxCmdLineParser&) OnCmdLineError__9wxAppBaseFR15wxCmdLineParser + ;wxAppBase::CreateLogTarget() + CreateLogTarget__9wxAppBaseFv ;wxAppBase::SetActive(unsigned long,wxWindow*) SetActive__9wxAppBaseFUlP8wxWindow ;From object file: ..\common\choiccmn.cpp @@ -4705,11 +4707,15 @@ EXPORTS __vft9wxProcess8wxObject ;wxProcess::Open(const wxString&,int) Open__9wxProcessFRC8wxStringi + ;wxProcess::IsErrorAvailable() const + IsErrorAvailable__9wxProcessCFv wxEVT_END_PROCESS ;wxProcess::Init(wxEvtHandler*,int,int) Init__9wxProcessFP12wxEvtHandleriT2 ;wxProcess::~wxProcess() __dt__9wxProcessFv + ;wxProcess::IsInputOpened() const + IsInputOpened__9wxProcessCFv ;wxConstructorForwxProcessEvent() wxConstructorForwxProcessEvent__Fv ;wxProcess::sm_classwxProcess @@ -4720,6 +4726,8 @@ EXPORTS OnTerminate__9wxProcessFiT1 ;wxProcess::Detach() Detach__9wxProcessFv + ;wxProcess::IsInputAvailable() const + IsInputAvailable__9wxProcessCFv ;From object file: ..\common\protocol.cpp ;PUBDEFs (Symbols available from object file): ;wxProtocol::wxProtocol() @@ -5212,10 +5220,12 @@ EXPORTS Add__7wxSizerFP7wxSizeriN22P8wxObject ;wxSizer::Prepend(int,int,int,int,int,wxObject*) Prepend__7wxSizerFiN41P8wxObject - ;wxFlexGridSizer::AddGrowableCol(unsigned int) - AddGrowableCol__15wxFlexGridSizerFUi + ;wxGridSizer::CalcRowsCols(int&,int&) const + CalcRowsCols__11wxGridSizerCFRiT1 ;wxBoxSizer::wxBoxSizer(int) __ct__10wxBoxSizerFi + ;wxFlexGridSizer::AddGrowableCol(unsigned int) + AddGrowableCol__15wxFlexGridSizerFUi ;wxSizerItem::IsSizer() IsSizer__11wxSizerItemFv ;wxNotebookSizer::sm_classwxNotebookSizer @@ -7196,15 +7206,15 @@ EXPORTS wxGetTopLevelParent__FP8wxWindow ;From object file: ..\common\wxchar.cpp ;PUBDEFs (Symbols available from object file): + ;wxVsnprintf_(char*,unsigned int,const char*,char*) + wxVsnprintf___FPcUiPCcT1 wcslen ;wxMB2WC(wchar_t*,const char*,unsigned int) wxMB2WC__FPwPCcUi - ;wxVsnprintf(char*,unsigned int,const char*,char*) - wxVsnprintf__FPcUiPCcT1 + ;wxSnprintf_(char*,unsigned int,const char*,...) + wxSnprintf___FPcUiPCce ;wxWC2MB(char*,const wchar_t*,unsigned int) wxWC2MB__FPcPCwUi - ;wxSnprintf(char*,unsigned int,const char*,...) - wxSnprintf__FPcUiPCce ;wxOKlibc() wxOKlibc__Fv ;From object file: ..\common\wxexpr.cpp @@ -9129,8 +9139,6 @@ EXPORTS SetItem__17wxGenericListCtrlFR10wxListItem ;wxListLineData::SetItem(int,const wxListItem&) SetItem__14wxListLineDataFiRC10wxListItem - ;wxGenericListCtrl::SetImageList(wxGenericImageList*,int) - SetImageList__17wxGenericListCtrlFP18wxGenericImageListi ;wxGenericListCtrl::SetColumnWidth(int,int) SetColumnWidth__17wxGenericListCtrlFiT1 ;wxGenericListCtrl::ScrollList(int,int) @@ -9223,8 +9231,8 @@ EXPORTS SetItem__16wxListHeaderDataFRC10wxListItem ;wxListMainWindow::SetItemState(long,long,long) SetItemState__16wxListMainWindowFlN21 - ;wxListMainWindow::SetImageList(wxGenericImageList*,int) - SetImageList__16wxListMainWindowFP18wxGenericImageListi + ;wxListMainWindow::SetImageList(wxImageList*,int) + SetImageList__16wxListMainWindowFP11wxImageListi ;wxGenericListCtrl::SetColumn(int,wxListItem&) SetColumn__17wxGenericListCtrlFiR10wxListItem ;wxListMainWindow::SetColumnWidth(int,int) @@ -9253,6 +9261,8 @@ EXPORTS DeleteColumn__17wxGenericListCtrlFi ;wxListMainWindow::CacheLineData(unsigned int) CacheLineData__16wxListMainWindowFUi + ;wxGenericListCtrl::AssignImageList(wxImageList*,int) + AssignImageList__17wxGenericListCtrlFP11wxImageListi ;wxGenericListCtrl::GetNextItem(long,int,int) const GetNextItem__17wxGenericListCtrlCFliT2 ;wxConstructorForwxListCtrl() @@ -9374,8 +9384,6 @@ EXPORTS DrawImage__16wxListMainWindowFiP4wxDCN21 ;wxListMainWindow::ChangeCurrent(unsigned int) ChangeCurrent__16wxListMainWindowFUi - ;wxGenericListCtrl::AssignImageList(wxGenericImageList*,int) - AssignImageList__17wxGenericListCtrlFP18wxGenericImageListi ;wxGenericListCtrl::~wxGenericListCtrl() __dt__17wxGenericListCtrlFv wxEVT_COMMAND_LIST_KEY_DOWN @@ -9590,6 +9598,8 @@ EXPORTS SetItem__16wxListMainWindowFR10wxListItem ;wxListItemData::SetItem(const wxListItem&) SetItem__14wxListItemDataFRC10wxListItem + ;wxGenericListCtrl::SetImageList(wxImageList*,int) + SetImageList__17wxGenericListCtrlFP11wxImageListi ;wxListMainWindow::SetColumn(int,wxListItem&) SetColumn__16wxListMainWindowFiR10wxListItem ;wxListLineDataArray::RemoveAt(unsigned int,unsigned int) @@ -11788,6 +11798,8 @@ EXPORTS ;PUBDEFs (Symbols available from object file): ;wxButton::Command(wxCommandEvent&) Command__8wxButtonFR14wxCommandEvent + ;wxButton::SetDefaultStyle(wxButton*,unsigned long) + SetDefaultStyle__8wxButtonFP8wxButtonUl ;wxButton::SetTmpDefault() SetTmpDefault__8wxButtonFv ;wxButton::WindowProc(unsigned int,void*,void*) @@ -11804,8 +11816,6 @@ EXPORTS __dt__8wxButtonFv ;wxButton::SendClickEvent() SendClickEvent__8wxButtonFv - ;wxButton::UpdateDefaultStyle(wxWindow*,wxWindow*) - UpdateDefaultStyle__8wxButtonFP8wxWindowT1 ;wxConstructorForwxButton() wxConstructorForwxButton__Fv ;wxButton::GetDefaultSize() @@ -12817,6 +12827,8 @@ EXPORTS HandleMenuSelect__7wxFrameFUsT1Ul ;wxFrame::OS2TranslateMessage(void**) OS2TranslateMessage__7wxFrameFPPv + ;wxFrame::SendSizeEvent() + SendSizeEvent__7wxFrameFv ;wxFrame::HandlePaint() HandlePaint__7wxFrameFv ;wxFrame::OnCreateStatusBar(int,long,int,const wxString&) @@ -13577,14 +13589,14 @@ EXPORTS GetDescription__14wxFileTypeImplCFP8wxString ;wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString&) EnumAllFileTypes__22wxMimeTypesManagerImplFR13wxArrayString + ;wxFileTypeImpl::GetIcon(wxIcon*,wxString*,int*) const + GetIcon__14wxFileTypeImplCFP6wxIconP8wxStringPi ;wxFileTypeImpl::GetOpenCommand(wxString*,const wxFileType::MessageParameters&) const GetOpenCommand__14wxFileTypeImplCFP8wxStringRCQ2_10wxFileType17MessageParameters ;wxFileTypeImpl::GetPrintCommand(wxString*,const wxFileType::MessageParameters&) const GetPrintCommand__14wxFileTypeImplCFP8wxStringRCQ2_10wxFileType17MessageParameters ;wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString&) GetFileTypeFromExtension__22wxMimeTypesManagerImplFRC8wxString - ;wxFileTypeImpl::GetIcon(wxIcon*) const - GetIcon__14wxFileTypeImplCFP6wxIcon ;wxFileTypeImpl::GetCommand(const char*) const GetCommand__14wxFileTypeImplCFPCc ;wxFileTypeImpl::GetMimeTypes(wxArrayString&) const @@ -14183,6 +14195,8 @@ EXPORTS m_svAllSpins__10wxSpinCtrl ;wxSpinCtrl::DoGetPosition(int*,int*) const DoGetPosition__10wxSpinCtrlCFPiT1 + ;wxSpinCtrl::SetSelection(long,long) + SetSelection__10wxSpinCtrlFlT1 ;wxSpinCtrl::DoMoveWindow(int,int,int,int) DoMoveWindow__10wxSpinCtrlFiN31 wxSpinCtrlWndProc