Weekly updates.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,9 +189,6 @@ protected:
|
|||||||
//
|
//
|
||||||
// Helper functions
|
// Helper functions
|
||||||
//
|
//
|
||||||
void ChangePage( int nOldSel
|
|
||||||
,int nSel
|
|
||||||
); // change pages
|
|
||||||
|
|
||||||
int m_nSelection; // The current selection (-1 if none)
|
int m_nSelection; // The current selection (-1 if none)
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@ public:
|
|||||||
{
|
{
|
||||||
Create(pParent, vId, rsValue, rPos, rSize, lStyle, rValidator, rsName);
|
Create(pParent, vId, rsValue, rPos, rSize, lStyle, rValidator, rsName);
|
||||||
}
|
}
|
||||||
|
~wxTextCtrl();
|
||||||
|
|
||||||
bool Create( wxWindow* pParent
|
bool Create( wxWindow* pParent
|
||||||
,wxWindowID vId
|
,wxWindowID vId
|
||||||
@@ -154,12 +155,16 @@ public:
|
|||||||
void OnPaste(wxCommandEvent& rEvent);
|
void OnPaste(wxCommandEvent& rEvent);
|
||||||
void OnUndo(wxCommandEvent& rEvent);
|
void OnUndo(wxCommandEvent& rEvent);
|
||||||
void OnRedo(wxCommandEvent& rEvent);
|
void OnRedo(wxCommandEvent& rEvent);
|
||||||
|
void OnDelete(wxCommandEvent& rEvent);
|
||||||
|
void OnSelectAll(wxCommandEvent& rEvent);
|
||||||
|
|
||||||
void OnUpdateCut(wxUpdateUIEvent& rEvent);
|
void OnUpdateCut(wxUpdateUIEvent& rEvent);
|
||||||
void OnUpdateCopy(wxUpdateUIEvent& rEvent);
|
void OnUpdateCopy(wxUpdateUIEvent& rEvent);
|
||||||
void OnUpdatePaste(wxUpdateUIEvent& rEvent);
|
void OnUpdatePaste(wxUpdateUIEvent& rEvent);
|
||||||
void OnUpdateUndo(wxUpdateUIEvent& rEvent);
|
void OnUpdateUndo(wxUpdateUIEvent& rEvent);
|
||||||
void OnUpdateRedo(wxUpdateUIEvent& rEvent);
|
void OnUpdateRedo(wxUpdateUIEvent& rEvent);
|
||||||
|
void OnUpdateDelete(wxUpdateUIEvent& rEvent);
|
||||||
|
void OnUpdateSelectAll(wxUpdateUIEvent& rEvent);
|
||||||
|
|
||||||
inline bool IsMLE(void) {return m_bIsMLE;}
|
inline bool IsMLE(void) {return m_bIsMLE;}
|
||||||
inline void SetMLE(bool bIsMLE) {m_bIsMLE = bIsMLE;}
|
inline void SetMLE(bool bIsMLE) {m_bIsMLE = bIsMLE;}
|
||||||
|
@@ -613,7 +613,7 @@ int wxEntry(
|
|||||||
{
|
{
|
||||||
if (wxTheApp->OnInit())
|
if (wxTheApp->OnInit())
|
||||||
{
|
{
|
||||||
nRetValue = wxTheApp->OnRun();
|
wxTheApp->OnRun();
|
||||||
}
|
}
|
||||||
// Normal exit
|
// Normal exit
|
||||||
wxWindow* pTopWindow = wxTheApp->GetTopWindow();
|
wxWindow* pTopWindow = wxTheApp->GetTopWindow();
|
||||||
@@ -641,7 +641,7 @@ int wxEntry(
|
|||||||
printf("wxTheApp->OnExit ");
|
printf("wxTheApp->OnExit ");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
wxTheApp->OnExit();
|
nRetValue = wxTheApp->OnExit();
|
||||||
#if wxUSE_CONSOLEDEBUG
|
#if wxUSE_CONSOLEDEBUG
|
||||||
printf("wxApp::CleanUp ");
|
printf("wxApp::CleanUp ");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@@ -173,37 +173,8 @@ void wxComboBox::SetValue(
|
|||||||
const wxString& rsValue
|
const wxString& rsValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
if ( HasFlag(wxCB_READONLY) )
|
||||||
// If newlines are denoted by just 10, must stick 13 in front.
|
SetStringSelection(rsValue);
|
||||||
//
|
|
||||||
int nSingletons = 0;
|
|
||||||
int nLen = rsValue.Length();
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < nLen; i ++)
|
|
||||||
{
|
|
||||||
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
|
|
||||||
nSingletons ++;
|
|
||||||
}
|
|
||||||
if (nSingletons > 0)
|
|
||||||
{
|
|
||||||
wxChar* zTmp = new wxChar[nLen + nSingletons + 1];
|
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
for (i = 0; i < nLen; i ++)
|
|
||||||
{
|
|
||||||
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
|
|
||||||
{
|
|
||||||
zTmp[j] = 13;
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
zTmp[j] = rsValue[i];
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
zTmp[j] = 0;
|
|
||||||
::WinSetWindowText(GetHwnd(), zTmp);
|
|
||||||
delete[] zTmp;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
::WinSetWindowText(GetHwnd(), rsValue.c_str());
|
::WinSetWindowText(GetHwnd(), rsValue.c_str());
|
||||||
} // end of wxComboBox::SetValue
|
} // end of wxComboBox::SetValue
|
||||||
|
@@ -212,19 +212,33 @@ int wxNotebook::SetSelection(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
|
||||||
int nOldPage = GetSelection();
|
|
||||||
|
|
||||||
ChangePage( m_nSelection
|
if (nPage != m_nSelection)
|
||||||
,nPage
|
{
|
||||||
);
|
wxNotebookEvent event( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
|
||||||
|
,m_windowId
|
||||||
|
);
|
||||||
|
vEvent.SetSelection(nPage);
|
||||||
|
vEvent.SetOldSelection(m_nSelection);
|
||||||
|
vEvent.SetEventObject(this);
|
||||||
|
if (!GetEventHandler()->ProcessEvent(vEvent) || vEvent.IsAllowed())
|
||||||
|
{
|
||||||
|
|
||||||
|
//
|
||||||
|
// Program allows the page change
|
||||||
|
//
|
||||||
|
vEvent.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
|
||||||
|
GetEventHandler()->ProcessEvent(vEvent);
|
||||||
|
|
||||||
ULONG ulPageId = (ULONG)m_alPageId[nPage];
|
ULONG ulPageId = (ULONG)m_alPageId[nPage];
|
||||||
|
|
||||||
::WinSendMsg( GetHWND()
|
::WinSendMsg( GetHWND()
|
||||||
,BKM_TURNTOPAGE
|
,BKM_TURNTOPAGE
|
||||||
,MPFROMLONG((ULONG)m_alPageId[nPage])
|
,MPFROMLONG((ULONG)m_alPageId[nPage])
|
||||||
,(MPARAM)0
|
,(MPARAM)0
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
m_nSelection = nPage;
|
m_nSelection = nPage;
|
||||||
return nPage;
|
return nPage;
|
||||||
} // end of wxNotebook::SetSelection
|
} // end of wxNotebook::SetSelection
|
||||||
@@ -891,56 +905,5 @@ bool wxNotebook::OS2OnScroll (
|
|||||||
);
|
);
|
||||||
} // end of wxNotebook::OS2OnScroll
|
} // end of wxNotebook::OS2OnScroll
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
// wxNotebook helper functions
|
|
||||||
// ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//
|
|
||||||
// Generate the page changing and changed events, hide the currently active
|
|
||||||
// panel and show the new one
|
|
||||||
//
|
|
||||||
void wxNotebook::ChangePage (
|
|
||||||
int nOldSel
|
|
||||||
, int nSel
|
|
||||||
)
|
|
||||||
{
|
|
||||||
static bool sbInsideChangePage = FALSE;
|
|
||||||
|
|
||||||
//
|
|
||||||
// When we call ProcessEvent(), our own OnSelChange() is called which calls
|
|
||||||
// this function - break the infinite loop
|
|
||||||
//
|
|
||||||
if (sbInsideChangePage)
|
|
||||||
return;
|
|
||||||
|
|
||||||
//
|
|
||||||
// It's not an error (the message may be generated by the tab control itself)
|
|
||||||
// and it may happen - just do nothing
|
|
||||||
//
|
|
||||||
if (nSel == nOldSel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sbInsideChangePage = TRUE;
|
|
||||||
|
|
||||||
wxNotebookEvent rEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
|
|
||||||
,m_windowId
|
|
||||||
);
|
|
||||||
|
|
||||||
rEvent.SetSelection(nSel);
|
|
||||||
rEvent.SetOldSelection(nOldSel);
|
|
||||||
rEvent.SetEventObject(this);
|
|
||||||
if (GetEventHandler()->ProcessEvent(rEvent) && !rEvent.IsAllowed())
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Program doesn't allow the page change
|
|
||||||
//
|
|
||||||
sbInsideChangePage = FALSE;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
rEvent.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
|
|
||||||
GetEventHandler()->ProcessEvent(rEvent);
|
|
||||||
sbInsideChangePage = FALSE;
|
|
||||||
} // end of wxNotebook::ChangePage
|
|
||||||
|
|
||||||
#endif // wxUSE_NOTEBOOK
|
#endif // wxUSE_NOTEBOOK
|
||||||
|
|
||||||
|
@@ -224,6 +224,63 @@ void wxRadioButton::SetValue(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
::WinSendMsg((HWND)GetHWND(), BM_SETCHECK, (MPARAM)bValue, (MPARAM)0);
|
::WinSendMsg((HWND)GetHWND(), BM_SETCHECK, (MPARAM)bValue, (MPARAM)0);
|
||||||
|
if (bValue)
|
||||||
|
{
|
||||||
|
const wxWindowList& rSiblings = GetParent()->GetChildren();
|
||||||
|
wxWindowList::Node* pNodeThis = rSiblings.Find(this);
|
||||||
|
|
||||||
|
wxCHECK_RET(pNodeThis, _T("radio button not a child of its parent?"));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Turn off all radio buttons before this one
|
||||||
|
//
|
||||||
|
for ( wxWindowList::Node* pNodeBefore = pNodeThis->GetPrevious();
|
||||||
|
pNodeBefore;
|
||||||
|
pNodeBefore = pNodeBefore->GetPrevious() )
|
||||||
|
{
|
||||||
|
wxRadioButton* pBtn = wxDynamicCast( pNodeBefore->GetData()
|
||||||
|
,wxRadioButton
|
||||||
|
);
|
||||||
|
if (!pBtn)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// The radio buttons in a group must be consecutive, so there
|
||||||
|
// are no more of them
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pBtn->SetValue(FALSE);
|
||||||
|
if (pBtn->HasFlag(wxRB_GROUP))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Even if there are other radio buttons before this one,
|
||||||
|
// they're not in the same group with us
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// ... and all after this one
|
||||||
|
//
|
||||||
|
for (wxWindowList::Node* pNodeAfter = pNodeThis->GetNext();
|
||||||
|
pNodeAfter;
|
||||||
|
pNodeAfter = pNodeAfter->GetNext())
|
||||||
|
{
|
||||||
|
wxRadioButton* pBtn = wxDynamicCast( pNodeAfter->GetData()
|
||||||
|
,wxRadioButton
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!pBtn || pBtn->HasFlag(wxRB_GROUP) )
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// No more buttons or the first button of the next group
|
||||||
|
//
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pBtn->SetValue(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
} // end of wxRadioButton::SetValue
|
} // end of wxRadioButton::SetValue
|
||||||
|
|
||||||
MRESULT wxRadioButton::OS2WindowProc(
|
MRESULT wxRadioButton::OS2WindowProc(
|
||||||
|
Reference in New Issue
Block a user