コード例 #1
0
EditServerListDlg::EditServerListDlg(wxWindow *parent,
                                     const wxString& caption,
                                     const wxString& message,
				     const wxString& filename) : wxDialog(parent, -1, caption,
								      wxDefaultPosition, wxSize(400,200),
								      wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
  m_file = filename;

  wxBeginBusyCursor();

  wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );

  topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );

  m_textctrl = new wxTextCtrl(this, -1, wxEmptyString,
			      wxDefaultPosition,
			      wxDefaultSize,
			      wxTE_MULTILINE);
  topsizer->Add( m_textctrl, 1, wxEXPAND | wxLEFT|wxRIGHT, 15 );

  topsizer->Add( CreateButtonSizer( wxOK | wxCANCEL ), 0, wxCENTRE | wxALL, 10 );

  SetAutoLayout( TRUE );
  SetSizer( topsizer );

  Centre( wxBOTH );

  if (wxFile::Exists(filename))
	m_textctrl->LoadFile(filename);

  m_textctrl->SetFocus();

  wxEndBusyCursor();
}
コード例 #2
0
ファイル: frmReport.cpp プロジェクト: apolyton/pgadmin3
///////////////////////////////////////////////////////
// Report base
///////////////////////////////////////////////////////
wxWindow *reportBaseFactory::StartDialog(frmMain *form, pgObject *obj)
{
	parent = form;

	wxBeginBusyCursor();
	frmReport *report = new frmReport(GetFrmMain());

	// Generate the report header
	wxDateTime now = wxDateTime::Now();
	report->XmlAddHeaderValue(wxT("generated"), now.Format(wxT("%c")));
	if (obj->GetServer())
		report->XmlAddHeaderValue(wxT("server"), obj->GetServer()->GetFullIdentifier());
	if (obj->GetDatabase())
		report->XmlAddHeaderValue(wxT("database"), obj->GetDatabase()->GetName());
	if (obj->GetSchema())
	{
		if (obj->GetSchema()->GetMetaType() == PGM_CATALOG)
			report->XmlAddHeaderValue(wxT("catalog"), obj->GetSchema()->GetDisplayName());
		else
			report->XmlAddHeaderValue(wxT("schema"), obj->GetSchema()->GetName());
	}
	if (obj->GetJob())
		report->XmlAddHeaderValue(wxT("job"), obj->GetJob()->GetName());
	if (obj->GetTable())
		report->XmlAddHeaderValue(wxT("table"), obj->GetTable()->GetName());

	GenerateReport(report, obj);
	wxEndBusyCursor();

	report->ShowModal();
	return 0;
}
コード例 #3
0
void IntensityCorrectionFilterPanel::OnSetProgress( wxCommandEvent& event )
{
  int progress = event.GetInt();
  
  // start_progress() sends -1
  if (progress < 0)
  {
    disabler_ = new wxWindowDisabler();
#ifndef _WIN32
    wxBeginBusyCursor();
#endif
    progress = 0;
  }
  // finish_progress() sends 101
  if (progress > 100)
  {
    if (disabler_) { delete disabler_; disabler_ = 0; }
#ifndef _WIN32
    wxEndBusyCursor();
#endif
    progress = 100;
  }
  if (progress == 0 || progress > mPercentage->GetValue())
  {
    mPercentage->SetValue(progress);
  }
}
コード例 #4
0
ファイル: numdlgg.cpp プロジェクト: ACanadianKernel/pcsx2
wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent,
                                         const wxString& message,
                                         const wxString& prompt,
                                         const wxString& caption,
                                         long value,
                                         long min,
                                         long max,
                                         const wxPoint& pos)
                   : wxDialog(parent, wxID_ANY, caption,
                              pos, wxDefaultSize)
{
    m_value = value;
    m_max = max;
    m_min = min;

    wxBeginBusyCursor();

    wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
#if wxUSE_STATTEXT
    // 1) text message
    topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
#endif

    // 2) prompt and text ctrl
    wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL );

#if wxUSE_STATTEXT
    // prompt if any
    if (!prompt.empty())
        inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 );
#endif

    // spin ctrl
    wxString valStr;
    valStr.Printf(wxT("%ld"), m_value);
    m_spinctrl = new wxSpinCtrl(this, wxID_ANY, valStr, wxDefaultPosition, wxSize( 140, wxDefaultCoord ), wxSP_ARROW_KEYS, (int)m_min, (int)m_max, (int)m_value);
    inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
    // add both
    topsizer->Add( inputsizer, 0, wxEXPAND | wxLEFT|wxRIGHT, 5 );

    // 3) buttons if any
    wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
    if ( buttonSizer )
    {
        topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder());
    }

    SetSizer( topsizer );
    SetAutoLayout( true );

    topsizer->SetSizeHints( this );
    topsizer->Fit( this );

    Centre( wxBOTH );

    m_spinctrl->SetSelection(-1, -1);
    m_spinctrl->SetFocus();

    wxEndBusyCursor();
}
コード例 #5
0
void SigUIFrame::OnTerminateInstall(wxProcessEvent &event)
{
    wxEndBusyCursor();
    wxWakeUpIdle();
    if (event.GetExitCode() == 0) {
	m_sig_candidates->Clear();
	wxLogMessage(_("Successfully installed new virus signatures\n"));
	reload();
    } else {
	bool had_errors = false;
	wxInputStream *err = m_siginst_process->GetErrorStream();
	wxTextInputStream tis(*err);

	while (!err->Eof()) {
	    wxString line = tis.ReadLine();
	    line.Trim();
	    if (!line.IsEmpty()) {
		wxLogWarning("%s", line);
		had_errors = true;
	    }
	}
	if (had_errors) {
	    wxLogError(_("Errors encountered during virus signature install"));
	}
    }
    delete m_siginst_process;

    m_panel_sigman->Enable();
}
コード例 #6
0
void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
{
    wxString reportName;

    bool make_report = m_CreateRptCtrl->IsChecked();

    if( make_report )      // Create a rpt file
    {
        reportName = m_RptFilenameCtrl->GetValue();

        if( reportName.IsEmpty() )
        {
            wxCommandEvent dummy;
            OnButtonBrowseRptFileClick( dummy );
        }

        if( !reportName.IsEmpty() )
            reportName = makeValidFileNameReport();
    }

    SetDrcParmeters();
    m_tester->SetSettings( true,        // Pad to pad DRC test enabled
                           true,        // unconnected pads DRC test enabled
                           true,        // DRC test for zones enabled
                           true,        // DRC test for keepout areas enabled
                           reportName, make_report );

    DelDRCMarkers();

    wxBeginBusyCursor();

    // run all the tests, with no UI at this time.
    m_Messages->Clear();
    wxSafeYield();                          // Allows time slice to refresh the m_Messages window
    m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations
    m_tester->RunTests(m_Messages);
    m_Notebook->ChangeSelection( 0 );       // display the 1at tab "...Markers ..."


    // Generate the report
    if( !reportName.IsEmpty() )
    {
        if( writeReport( reportName ) )
        {
            wxString        msg;
            msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );

            wxString        caption( _( "Disk File Report Completed" ) );
            wxMessageDialog popupWindow( this, msg, caption );
            popupWindow.ShowModal();
        }
        else
            DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "),
                          GetChars( reportName ) ) );
    }

    wxEndBusyCursor();

    RedrawDrawPanel();
}
コード例 #7
0
ファイル: CamShiftPlugin.cpp プロジェクト: conanhung/examples
void CamShiftPlugin::OnOK()
{
	wxBeginBusyCursor();
	if (!GetScope())
		ProcessImage(cm->book[cm->GetPos()], cm->GetPos());
	else{
		FetchParams();
		ImagePlus *oimg;
		CvRect orect, searchwin;
		CvPoint ocenter;
		oimg = cm->book[0];
		int numContours = (int) oimg->contourArray.size();
		for (int i=1; i<cm->GetFrameCount(); i++)
			cm->book[i]->CloneContours(oimg);
		int frameCount = cm->GetFrameCount();
		CreateProgressDlg(numContours*frameCount);
		bool cont=true;
		for (int j=0; j<numContours && cont; j++){
			for (int i=1; i<frameCount && (cont=progressDlg->Update(j*frameCount+i, wxString::Format("Cell %d of %d, Frame %d of %d", j+1,numContours, i+1, frameCount))); i++){
				ProcessStatic(j, cm->book[i], cm->book[useFirst ? 0 : i-1], hsizes, criteria,
		planes, hist, backproject, orect, ocenter, searchwin, rotation, shift, i>1);
			}
		}
		DestroyProgressDlg();
	}
	cm->ReloadCurrentFrameContours(true, false);
	wxEndBusyCursor();
}
コード例 #8
0
void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
{
    wxString reportName;

    bool make_report = m_CreateRptCtrl->IsChecked();

    if( make_report )      // Create a file rpt
    {
        reportName = m_RptFilenameCtrl->GetValue();

        if( reportName.IsEmpty() )
        {
            wxCommandEvent junk;
            OnButtonBrowseRptFileClick( junk );
        }

        if( !reportName.IsEmpty() )
            reportName = makeValidFileNameReport();
    }

    SetDrcParmeters();

    m_tester->SetSettings( true,        // Pad to pad DRC test enabled
                           true,        // unconnected pads DRC test enabled
                           true,        // DRC test for zones enabled
                           true,        // DRC test for keepout areas enabled
                           reportName, make_report );

    DelDRCMarkers();

    wxBeginBusyCursor();

    m_Messages->Clear();
    m_tester->ListUnconnectedPads();

    m_Notebook->ChangeSelection( 1 );       // display the 2nd tab "Unconnected..."

    // Generate the report
    if( !reportName.IsEmpty() )
    {
        if( writeReport( reportName ) )
        {
            wxString        msg;
            msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
            wxString        caption( _( "Disk File Report Completed" ) );
            wxMessageDialog popupWindow( this, msg, caption );
            popupWindow.ShowModal();
        }
        else
            DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "),
                          GetChars( reportName ) ) );
    }

    wxEndBusyCursor();

    /* there is currently nothing visible on the DrawPanel for unconnected pads
     *  RedrawDrawPanel();
     */
}
コード例 #9
0
ファイル: cropvolcylinder.cpp プロジェクト: viscenter/educe
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for START_BUTTON
 */
void CropVolCylinder::OnStartButtonClick( wxCommandEvent& event )
{
  wxBeginBusyCursor();
  SCIRun::Painter::ThrowSkinnerSignal("Painter::FinishTool");
  wxEndBusyCursor();

  SCIRun::Painter::global_seg3dframe_pointer_->HideTool();
}
コード例 #10
0
ファイル: dialog_drc.cpp プロジェクト: chgans/kicad
void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
{
    wxString reportName;

    if( m_CreateRptCtrl->IsChecked() )      // Create a file rpt
    {
        reportName = m_RptFilenameCtrl->GetValue();

        if( reportName.IsEmpty() )
        {
            wxCommandEvent junk;
            OnButtonBrowseRptFileClick( junk );
        }

        reportName = m_RptFilenameCtrl->GetValue();
    }

    SetDrcParmeters();

    m_tester->SetSettings( true,        // Pad to pad DRC test enabled
                           true,        // unconnected pdas DRC test enabled
                           true,        // DRC test for zones enabled
                           true,        // DRC test for keepout areas enabled
                           reportName, m_CreateRptCtrl->IsChecked() );

    DelDRCMarkers();

    wxBeginBusyCursor();

    // run all the tests, with no UI at this time.
    m_Messages->Clear();
    wxSafeYield();                          // Allows time slice to refresh the m_Messages window
    m_tester->m_pcb->m_Status_Pcb = 0;      // Force full connectivity and ratsnest recalculations
    m_tester->RunTests(m_Messages);

    m_Notebook->ChangeSelection( 0 );       // display the 1at tab "...Markers ..."


    // Generate the report
    if( !reportName.IsEmpty() )
    {
        FILE* fp = wxFopen( reportName, wxT( "w" ) );
        writeReport( fp );
        fclose( fp );

        wxString        msg;
        msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );

        wxString        caption( _( "Disk File Report Completed" ) );
        wxMessageDialog popupWindow( this, msg, caption );

        popupWindow.ShowModal();
    }

    wxEndBusyCursor();

    RedrawDrawPanel();
}
コード例 #11
0
ファイル: AnPickFromFs.cpp プロジェクト: genua/anoubis
void
AnPickFromFs::onPickButton(wxCommandEvent &)
{
	if (pickButtonMenu_.IsChecked(dirMenuId_)) {
		wxDirDialog	*dlg;
		long		 flags = wxDD_DEFAULT_STYLE;

		if ((pickerMode_ & MODE_NEW) == 0)
			flags |= wxDD_DIR_MUST_EXIST;

		dlg = new wxDirDialog(this,wxEmptyString, wxEmptyString, flags);

		wxBeginBusyCursor();
		dlg->SetPath(getDialogPath());
		wxEndBusyCursor();

		if (dlg->ShowModal() == wxID_OK) {
			adoptFileName(dlg->GetPath());
		}
		dlg->Destroy();
	} else {
		wxFileDialog	*dlg;
		long		 flags;
		wxFileName	 defaultPath;

		defaultPath.Assign(fileName_);
		flags  = wxDD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST;
		if (pickerMode_ & MODE_NEW)
			flags = wxFD_SAVE;

		dlg = new wxFileDialog(this,wxEmptyString, wxEmptyString,
		    wxEmptyString, wxEmptyString, flags);

		wxBeginBusyCursor();
		dlg->SetDirectory(getDialogPath());
		dlg->SetFilename(defaultPath.GetFullName());
		dlg->SetWildcard(wxT("*"));
		wxEndBusyCursor();

		if (dlg->ShowModal() == wxID_OK) {
			adoptFileName(dlg->GetPath());
		}
		dlg->Destroy();
	}
}
コード例 #12
0
ファイル: colrdlgg.cpp プロジェクト: iokto/newton-dynamics
void wxGenericColourDialog::CreateWidgets()
{
    wxBeginBusyCursor();

    wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );

    const int sliderHeight = 160;

    // first sliders
#if wxUSE_SLIDER
    const int sliderX = m_singleCustomColourRect.x + m_singleCustomColourRect.width + m_sectionSpacing;

    m_redSlider = new wxSlider(this, wxID_RED_SLIDER, m_colourData.m_dataColour.Red(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    m_greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, m_colourData.m_dataColour.Green(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    m_blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, m_colourData.m_dataColour.Blue(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);

    wxBoxSizer *sliderSizer = new wxBoxSizer( wxHORIZONTAL );

    sliderSizer->Add(sliderX, sliderHeight );

    wxSizerFlags flagsRight;
    flagsRight.Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL).DoubleBorder();

    sliderSizer->Add(m_redSlider, flagsRight);
    sliderSizer->Add(m_greenSlider,flagsRight);
    sliderSizer->Add(m_blueSlider,flagsRight);

    topSizer->Add(sliderSizer, wxSizerFlags().Centre().DoubleBorder());
#else
    topSizer->Add(1, sliderHeight, wxSizerFlags(1).Centre().TripleBorder());
#endif // wxUSE_SLIDER

    // then the custom button
    topSizer->Add(new wxButton(this, wxID_ADD_CUSTOM,
                                  _("Add to custom colours") ),
                     wxSizerFlags().DoubleHorzBorder());

    // then the standard buttons
    wxSizer *buttonsizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
    if ( buttonsizer )
    {
        topSizer->Add(buttonsizer, wxSizerFlags().Expand().DoubleBorder());
    }

    SetAutoLayout( true );
    SetSizer( topSizer );

    topSizer->SetSizeHints( this );
    topSizer->Fit( this );

    Centre( wxBOTH );

    wxEndBusyCursor();
}
コード例 #13
0
ファイル: wxldserv.cpp プロジェクト: oeuftete/wx-xword
void wxLuaDebuggerBase::OnDebugTableEnum(wxLuaDebuggerEvent &event)
{
    if (GetStackDialog() != NULL)
        GetStackDialog()->FillTableEntry(event.GetReference(), event.GetDebugData());
    else
        event.Skip();

    wxEndBusyCursor();
}
コード例 #14
0
ファイル: wxldserv.cpp プロジェクト: oeuftete/wx-xword
void wxLuaDebuggerBase::OnDebugStackEnum(wxLuaDebuggerEvent &event)
{
    if (GetStackDialog() != NULL)
        GetStackDialog()->FillStackCombobox(event.GetDebugData());
    else
        event.Skip();

    wxEndBusyCursor();
}
コード例 #15
0
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ERASE_BUTTON
 */
void PolylineToolPanel::OnEraseButtonClick( wxCommandEvent& event )
{
  wxBeginBusyCursor();
  SCIRun::ThrowSkinnerSignalEvent *tsse =
    new SCIRun::ThrowSkinnerSignalEvent("Painter::FinishTool");
  tsse->add_var("Painter::polylinetool_erase", "1");
  SCIRun::Painter::ThrowSkinnerSignal(tsse);
  wxEndBusyCursor();
}
コード例 #16
0
ファイル: DecisionLogic.cpp プロジェクト: e1d1s1/Logician
void DecisionLogicFrame::OnSaveProject(wxCommandEvent& WXUNUSED(event))
{
	wxBeginBusyCursor();
	this->m_tree->Enable(false);
	if (m_worker->Save())
		EnableAllMenus();
	this->m_tree->Enable(true);
	wxEndBusyCursor();
}
コード例 #17
0
ファイル: App.cpp プロジェクト: dragonlet/fw4spl
int App::OnExit()
{
    SLM_TRACE_FUNC();

    wxBeginBusyCursor();
    //::fwServices::RootManager::uninitializeRootObject();
    wxEndBusyCursor();

    delete m_checker;
    return 0;
}
コード例 #18
0
void wxCheatsWindow::OnEvent_ButtonUpdateLog_Press(wxCommandEvent& WXUNUSED(event))
{
	wxBeginBusyCursor();
	m_textctrl_log->Freeze();
	m_textctrl_log->Clear();
	for (const std::string& text : ActionReplay::GetSelfLog())
	{
		m_textctrl_log->AppendText(StrToWxStr(text));
	}
	m_textctrl_log->Thaw();
	wxEndBusyCursor();
}
コード例 #19
0
ファイル: wxCursor.cpp プロジェクト: rinkevichjm/rwx
DLL_LOCAL VALUE _busy(int argc,VALUE *argv,VALUE self)
{
    VALUE cursor;
    rb_scan_args(argc, argv, "01",&cursor);

    app_protected();

    wxBeginBusyCursor(NIL_P(cursor) ? wxHOURGLASS_CURSOR : unwrap<wxCursor*>(cursor));
    rb_yield(Qnil);
    wxEndBusyCursor();
    return self;
}
コード例 #20
0
bool wxDiagram::LoadFile(const wxString& filename)
{
  wxBeginBusyCursor();

  wxExprDatabase database(wxExprInteger, _T("id"));
  if (!database.Read(filename))
  {
    wxEndBusyCursor();
    return false;
  }

  DeleteAllShapes();

  database.BeginFind();
  wxExpr *header = database.FindClauseByFunctor(_T("diagram"));

  if (header)
    OnHeaderLoad(database, *header);

  // Scan through all clauses and register the ids
  wxNode *node = database.GetFirst();
  while (node)
  {
    wxExpr *clause = (wxExpr *)node->GetData();
    long id = -1;
    clause->GetAttributeValue(_T("id"), id);
    wxRegisterId(id);
    node = node->GetNext();
  }

  ReadNodes(database);
  ReadContainerGeometry(database);
  ReadLines(database);

  OnDatabaseLoad(database);

  wxEndBusyCursor();

  return true;
}
コード例 #21
0
ファイル: histoeqfilter.cpp プロジェクト: viscenter/educe
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for START_BUTTON
 */
void HistoEqFilter::OnStartButtonClick( wxCommandEvent& event )
{
  // Call synchronously and wait.
  wxBeginBusyCursor();
  SCIRun::ThrowSkinnerSignalEvent *tsse =
    new SCIRun::ThrowSkinnerSignalEvent("Painter::HistoEqFilter");
  tsse->add_var("Painter::HistoEq::bins",
                SCIRun::to_string(mIgnore->GetValue()));
  tsse->add_var("Painter::HistoEq::alpha",
                wx2std(mAlpha->GetValue()));
  SCIRun::Painter::ThrowSkinnerSignal(tsse);
  wxEndBusyCursor();
}
コード例 #22
0
ファイル: customdlg.cpp プロジェクト: Ifsttar/I-Simpa
wxCustomEntryDialog::wxCustomEntryDialog(wxWindow *parent,
                                         const wxString& message,
                                         const wxString& caption,
                                         const wxPoint& pos)
                   : wxDialog(parent, wxID_ANY, caption,
				   pos, wxDefaultSize,wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX | wxRESIZE_BORDER)
{

	this->SetMinSize(FromDIP(wxSize(320,320)));
    wxBeginBusyCursor();

	wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL );
#if wxUSE_STATTEXT
    // 1) text message
    topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 );
#endif

    // 2) prompt and text ctrl
	wxBoxSizer* vinputsizer = new wxBoxSizer(wxHORIZONTAL);

	//vinputsizer->SetVGap(5);
	//vinputsizer->SetHGap(5);

	topsizer->Add( vinputsizer, 1, wxEXPAND | wxTOP|wxBOTTOM, 5 );

    // 3) buttons if any
    wxSizer *buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
    if ( buttonSizer )
    {
        topsizer->Add(buttonSizer, wxSizerFlags().Expand().DoubleBorder());
    }

	PropGrid* newGrid=new PropGrid(this,wxCustomEntryDialog::CUSTOM_DIALOG_CTRLS_GRID);
	vinputsizer->Add( newGrid,1,wxEXPAND);
	//newGrid->SetMinSize(FromDIP(wxSize(300,200)));
	//newGrid->AppendCols();
	newGrid->SetColLabelValue(0,_("Value"));
	newGrid->SetColLabelAlignment(wxVERTICAL,wxALIGN_LEFT);

    SetSizer( topsizer );
    SetAutoLayout( true );

    topsizer->SetSizeHints( this );
    topsizer->Fit( this );

    Centre( wxBOTH );



    wxEndBusyCursor();
}
コード例 #23
0
void wxGenericColourDialog::CreateWidgets()
{
    wxBeginBusyCursor();

    wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );

    const int sliderHeight = 160;

#if wxUSE_SLIDER
    const int sliderX = singleCustomColourRect.x + singleCustomColourRect.width + sectionSpacing;

    redSlider = new wxSlider(this, wxID_RED_SLIDER, colourData.m_dataColour.Red(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    greenSlider = new wxSlider(this, wxID_GREEN_SLIDER, colourData.m_dataColour.Green(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);
    blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, colourData.m_dataColour.Blue(), 0, 255,
        wxDefaultPosition, wxSize(wxDefaultCoord, sliderHeight), wxSL_VERTICAL|wxSL_LABELS|wxSL_INVERSE);

    wxBoxSizer *sliderSizer = new wxBoxSizer( wxHORIZONTAL );

    // 1) space for sliders
    sliderSizer->Add( sliderX, sliderHeight );
    sliderSizer->Add( redSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );
    sliderSizer->Add( greenSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );
    sliderSizer->Add( blueSlider, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 10 );

    topSizer->Add( sliderSizer, 0, wxCENTRE | wxALL, 10 );
#else
    topSizer->Add( 1, sliderHeight, 0, wxCENTRE | wxALL, 15 );
#endif // wxUSE_SLIDER

#if wxUSE_STATLINE
    // 2) static line
    topSizer->Add( new wxStaticLine( this, wxID_ANY ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif

    // 3) buttons
    wxSizer *buttonsizer = CreateButtonSizer( wxOK|wxCANCEL );
    buttonsizer->Add( new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours") ), 0, wxLEFT|wxRIGHT, 10 );
    topSizer->Add( buttonsizer, 0, wxEXPAND | wxALL, 10 );

    SetAutoLayout( true );
    SetSizer( topSizer );

    topSizer->SetSizeHints( this );
    topSizer->Fit( this );

    Centre( wxBOTH );

    wxEndBusyCursor();
}
コード例 #24
0
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for START_BUTTON
 */
void OptionlessFilter::OnStartButtonClick( wxCommandEvent& event )
{
  if (show_progress_)
  {
    SCIRun::Painter::ThrowSkinnerSignal(skinner_callback_, false);
  }
  else
  {
    // Call synchronously and wait.
    wxBeginBusyCursor();
    SCIRun::Painter::ThrowSkinnerSignal(skinner_callback_, true);
    wxEndBusyCursor();
  }
}
コード例 #25
0
ファイル: resampletool.cpp プロジェクト: pip010/scirun4plus
/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for START_BUTTON
 */
void ResampleTool::OnStartButtonClick( wxCommandEvent& event )
{
  wxBeginBusyCursor();
  SCIRun::ThrowSkinnerSignalEvent *tsse =
    new SCIRun::ThrowSkinnerSignalEvent("Painter::FinishTool");
  tsse->add_var( "Painter::Resample::x", SCIRun::to_string( mX->GetValue() ) );
  tsse->add_var( "Painter::Resample::y", SCIRun::to_string( mY->GetValue() ) );
  tsse->add_var( "Painter::Resample::z", SCIRun::to_string( mZ->GetValue() ) );
  tsse->add_var( "Painter::Resample::filter", wx2std( mFilter->GetStringSelection() ) );
  SCIRun::Painter::ThrowSkinnerSignal(tsse);
  wxEndBusyCursor();

  SCIRun::Painter::global_seg3dframe_pointer_->HideTool();
}
コード例 #26
0
wxMessageDialogEx::wxMessageDialogEx( wxWindow *parent, const wxString& message, const wxString &caption,
    long style, const wxPoint& position) :
    wxDialog( parent, -1, caption, position, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
{
    m_dialogStyle = style;

    wxBeginBusyCursor();

    wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL );

    // 1) icon
    if (style & wxICON_MASK)
    {
         wxStaticBitmap *icon = new wxStaticBitmap(
            this, -1, wxTheApp->GetStdIcon((int)(style & wxICON_MASK)));
         icon_text->Add( icon, 0, wxCENTER );
    }

    // 2) text
    icon_text->Add( CreateTextSizer( message ), 0, wxCENTER | wxLEFT, 10 );

    topsizer->Add( icon_text, 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );

#if wxUSE_STATLINE
    // 3) static line
    topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
#endif

    // 4) buttons
    topsizer->Add( CreateButtonSizer( style ), 0, wxCENTRE | wxALL, 10 );

    SetAutoLayout( TRUE );
    SetSizer( topsizer );

    topsizer->SetSizeHints( this );
    topsizer->Fit( this );
    wxSize size( GetSize() );
    if (size.x < size.y*3/2)
    {
        size.x = size.y*3/2;
        SetSize( size );
    }

    Centre( wxBOTH | wxCENTER_FRAME);

    wxEndBusyCursor();
}
コード例 #27
0
ファイル: app.cpp プロジェクト: vdm113/wxWidgets-ICC-patch
void wxGUIAppTraits::AfterChildWaitLoop(void *dataOrig)
{
    wxEndBusyCursor();

    ChildWaitLoopData * const data = (ChildWaitLoopData *)dataOrig;

    delete data->wd;

    // finally delete the dummy dialog and, as wd has been already destroyed
    // and the other windows reenabled, the activation is going to return to
    // the window which had had it before
    data->winActive->Destroy();

    // also delete the temporary data object itself
    delete data;
}
コード例 #28
0
ファイル: dialogs.cpp プロジェクト: silky/ready
MultiLineDialog::MultiLineDialog(wxWindow *parent,
                                 const wxString& caption,
                                 const wxString& message,
                                 const wxString& value)
     : wxDialog(GetParentForModalDialog(parent, wxOK | wxCANCEL),
                wxID_ANY, caption, wxDefaultPosition, wxDefaultSize,
                wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
    wxBeginBusyCursor();

    wxBoxSizer* topsizer = new wxBoxSizer( wxVERTICAL );

    wxSizerFlags flagsBorder2;
    flagsBorder2.DoubleBorder();

    topsizer->Add(CreateTextSizer(message), flagsBorder2);

    m_textctrl = new wxTextCtrl(this, wxID_ANY, value,
                                wxDefaultPosition, wxSize(100,50), wxTE_MULTILINE | wxTE_PROCESS_TAB);
    #ifdef __WXMAC__
        // need bigger font on Mac, and need to specify facename to get Monaco instead of Courier
        wxFont font(12, wxMODERN, wxNORMAL, wxNORMAL, false, wxT("Monaco"));
    #else
        wxFont font(10, wxTELETYPE, wxFONTSTYLE_NORMAL, wxNORMAL, false, _T("Monospace"), wxFONTENCODING_DEFAULT);
    #endif
    m_textctrl->SetFont(font);
    
    // allow people to use small dialog if they wish
    // m_textctrl->SetMinSize(wxSize(800,500));

    topsizer->Add(m_textctrl, wxSizerFlags(1).Expand().TripleBorder(wxLEFT | wxRIGHT));

    wxSizer* buttonSizer = CreateSeparatedButtonSizer(wxOK | wxCANCEL);
    topsizer->Add(buttonSizer, wxSizerFlags(flagsBorder2).Expand());

    SetAutoLayout(true);
    SetSizer(topsizer);

    topsizer->SetSizeHints(this);
    topsizer->Fit(this);

    m_textctrl->SetFocus();
    m_textctrl->SetSelection(0,0);      // probably nicer not to select all text

    wxEndBusyCursor();
}
コード例 #29
0
void MyFrame::OnDial(wxCommandEvent& WXUNUSED(event))
{
    wxLogStatus(this, wxT("Preparing to dial..."));
    wxYield();
    wxBeginBusyCursor();

    if ( wxGetApp().GetDialer()->Dial() )
    {
        wxLogStatus(this, wxT("Dialing..."));
    }
    else
    {
        wxLogStatus(this, wxT("Dialing attempt failed."));
    }

    wxEndBusyCursor();
}
コード例 #30
0
void
RuleWizardContextExceptionPage::onAddButton(wxCommandEvent &)
{
	wxFileDialog *fileDlg = new wxFileDialog(this);

	wxBeginBusyCursor();
	fileDlg->SetDirectory(wxT("/usr/bin"));
	fileDlg->SetFilename(wxEmptyString);
	fileDlg->SetWildcard(wxT("*"));
	wxEndBusyCursor();

	if (fileDlg->ShowModal() == wxID_OK) {
		history_->getContextExceptions()->add(fileDlg->GetPath());
		updateNavi();
	}

	fileDlg->Destroy();
}