Applied patches.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2004-03-29 18:02:59 +00:00
parent 3a72b6a474
commit 963907fa8f
2 changed files with 25 additions and 19 deletions

View File

@ -496,23 +496,34 @@ void wxPreviewControlBar::CreateButtons()
void wxPreviewControlBar::SetZoomControl(int zoom)
{
wxChar buf[20];
wxSprintf( buf, wxT("%d%%"), zoom );
if (m_zoomControl)
m_zoomControl->SetStringSelection(buf);
{
int n, count = m_zoomControl->GetCount();
long val;
for (n=0; n<count; n++)
{
if (m_zoomControl->GetString(n).BeforeFirst(wxT('%')).ToLong(&val) &&
(val >= long(zoom)))
{
m_zoomControl->SetSelection(n);
return;
}
}
m_zoomControl->SetSelection(count-1);
}
}
int wxPreviewControlBar::GetZoomControl()
{
wxChar buf[20];
if (m_zoomControl && (m_zoomControl->GetStringSelection() != wxT("")))
if (m_zoomControl && (m_zoomControl->GetStringSelection() != wxEmptyString))
{
wxStrcpy(buf, m_zoomControl->GetStringSelection());
buf[wxStrlen(buf) - 1] = 0;
return (int)wxAtoi(buf);
long val;
if (m_zoomControl->GetStringSelection().BeforeFirst(wxT('%')).ToLong(&val))
return int(val);
}
else return 0;
return 0;
}

View File

@ -705,21 +705,16 @@ wxGenericPageSetupDialog::~wxGenericPageSetupDialog()
{
}
static inline wxString IntToString( long value )
{
return wxString::Format(wxT("%ld"), value);
}
bool wxGenericPageSetupDialog::TransferDataToWindow()
{
if (m_marginLeftText)
m_marginLeftText->SetValue(IntToString(m_pageData.GetMarginTopLeft().x));
m_marginLeftText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginTopLeft().x));
if (m_marginTopText)
m_marginTopText->SetValue(IntToString(m_pageData.GetMarginTopLeft().y));
m_marginTopText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginTopLeft().y));
if (m_marginRightText)
m_marginRightText->SetValue(IntToString(m_pageData.GetMarginBottomRight().x));
m_marginRightText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginBottomRight().x));
if (m_marginBottomText)
m_marginBottomText->SetValue(IntToString(m_pageData.GetMarginBottomRight().y));
m_marginBottomText->SetValue(wxString::Format(wxT("%d"), m_pageData.GetMarginBottomRight().y));
if (m_orientationRadioBox)
{