Save dialog for printing. Source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-01-25 07:24:11 +00:00
parent bdb5436554
commit 2312c9e1d0

View File

@@ -187,17 +187,17 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
if (factory->HasPrinterLine())
{
flex->Add( new wxStaticText( this, -1, _("Printer:") ),
flex->Add( new wxStaticText( this, wxID_ANY, _("Printer:") ),
0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
flex->Add( new wxStaticText( this, -1, factory->CreatePrinterLine() ),
flex->Add( new wxStaticText( this, wxID_ANY, factory->CreatePrinterLine() ),
0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
}
if (factory->HasStatusLine())
{
flex->Add( new wxStaticText( this, -1, _("Status:") ),
flex->Add( new wxStaticText( this, wxID_ANY, _("Status:") ),
0, wxALIGN_CENTER_VERTICAL|wxALL-wxTOP, 5 );
flex->Add( new wxStaticText( this, -1, factory->CreateStatusLine() ),
flex->Add( new wxStaticText( this, wxID_ANY, factory->CreateStatusLine() ),
0, wxALIGN_CENTER_VERTICAL|wxALL-wxTOP, 5 );
}
@@ -294,7 +294,7 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event))
wxFileName fname( m_printDialogData.GetPrintData().GetFilename() );
wxFileDialog dialog( this, _("PostScript file"),
fname.GetPath(), fname.GetFullName(), wxT("*.ps"), wxOPEN | wxOVERWRITE_PROMPT );
fname.GetPath(), fname.GetFullName(), wxT("*.ps"), wxSAVE | wxOVERWRITE_PROMPT );
if (dialog.ShowModal() != wxID_OK) return;
m_printDialogData.GetPrintData().SetFilename( dialog.GetPath() );
@@ -486,11 +486,11 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
// printer selection
wxStaticBoxSizer *printer_sizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, _("Printer") ), wxVERTICAL );
wxStaticBoxSizer *printer_sizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Printer") ), wxVERTICAL );
main_sizer->Add( printer_sizer, 0, wxALL|wxGROW, 10 );
m_printerListCtrl = new wxListCtrl( this, wxPRINTID_PRINTER,
wxDefaultPosition, wxSize(-1,100), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
wxDefaultPosition, wxSize(wxDefaultCoord,100), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
wxImageList *image_list = new wxImageList;
image_list->Add( wxBitmap(check_xpm) );
m_printerListCtrl->AssignImageList( image_list, wxIMAGE_LIST_SMALL );
@@ -506,7 +506,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
item.SetText( _("Default printer") );
item.SetId( m_printerListCtrl->InsertItem( item ) );
if (data->GetPrinterName().IsEmpty())
if (data->GetPrinterName().empty())
{
wxListItem item2;
item2.SetId( item.GetId() );
@@ -560,7 +560,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
{
tmp = output2[0]; // "printer hp_deskjet930c is idle. enable since ..."
int pos = tmp.Find( wxT('.') );
if (pos != -1)
if (pos != wxNOT_FOUND)
tmp.Remove( (size_t)pos, tmp.Len()-(size_t)pos );
wxStringTokenizer tok2( tmp, wxT(" ") );
tmp = tok2.GetNextToken(); // "printer"
@@ -607,7 +607,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
m_orientationRadioBox= new wxRadioBox( this, wxPRINTID_ORIENTATION, _("Orientation"), wxDefaultPosition, wxDefaultSize, 2, strs6, 1, wxRA_SPECIFY_ROWS );
item2->Add( m_orientationRadioBox, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxStaticBox *item8 = new wxStaticBox( this, -1, _("Options") );
wxStaticBox *item8 = new wxStaticBox( this, wxID_ANY, _("Options") );
wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxHORIZONTAL );
m_colourCheckBox = new wxCheckBox( this, wxPRINTID_PRINTCOLOUR, _("Print in colour") );
@@ -619,29 +619,29 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
// spooling options (on the right)
wxStaticBox *item11 = new wxStaticBox( this, -1, _("Print spooling") );
wxStaticBox *item11 = new wxStaticBox( this, wxID_ANY, _("Print spooling") );
wxStaticBoxSizer *item10 = new wxStaticBoxSizer( item11, wxVERTICAL );
wxStaticText *item12 = new wxStaticText( this, -1, _("Printer command:") );
wxStaticText *item12 = new wxStaticText( this, wxID_ANY, _("Printer command:") );
item10->Add( item12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxBoxSizer *item13 = new wxBoxSizer( wxHORIZONTAL );
item13->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
m_printerCommandText = new wxTextCtrl( this, wxPRINTID_COMMAND, wxT(""), wxDefaultPosition, wxSize(160,-1) );
m_printerCommandText = new wxTextCtrl( this, wxPRINTID_COMMAND, wxT(""), wxDefaultPosition, wxSize(160,wxDefaultCoord) );
item13->Add( m_printerCommandText, 0, wxALIGN_CENTER|wxALL, 5 );
item10->Add( item13, 0, wxALIGN_CENTER|wxALL, 0 );
wxStaticText *item15 = new wxStaticText( this, -1, _("Printer options:") );
wxStaticText *item15 = new wxStaticText( this, wxID_ANY, _("Printer options:") );
item10->Add( item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxBoxSizer *item16 = new wxBoxSizer( wxHORIZONTAL );
item16->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
m_printerOptionsText = new wxTextCtrl( this, wxPRINTID_OPTIONS, wxT(""), wxDefaultPosition, wxSize(160,-1) );
m_printerOptionsText = new wxTextCtrl( this, wxPRINTID_OPTIONS, wxT(""), wxDefaultPosition, wxSize(160,wxDefaultCoord) );
item16->Add( m_printerOptionsText, 0, wxALIGN_CENTER|wxALL, 5 );
item10->Add( item16, 0, wxALIGN_CENTER|wxALL, 0 );
@@ -651,7 +651,7 @@ void wxGenericPrintSetupDialog::Init(wxPrintData* data)
#if wxUSE_STATLINE
// static line
main_sizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
main_sizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif
// buttons