Ejemplo n.º 1
0
void LabelDialog::OnChangeTrack(wxGridEvent &event, int row, RowData *rd)
{
   wxString val = mGrid->GetCellValue(row, Col_Track);

   // User selected the "New..." choice so ask for a new name
   if (mTrackNames.Index(val) == 0) {
      wxTextEntryDialog d(this,
                          _("New Label Track"),
                          _("Enter track name"),
                          _("Label Track"));

      // User canceled so repopulating the grid will set the track
      // name to the orignal value
      if (d.ShowModal() == wxID_CANCEL) {
         TransferDataToWindow();
         return;
      }

      // Force generation of a new track name
      rd->index = 0;
      TrackName(rd->index, d.GetValue());
   }
   else {
      // Remember the tracks index
      rd->index = mTrackNames.Index(val);
   }

   // Repopulate the grid
   TransferDataToWindow();

   return;
}
Ejemplo n.º 2
0
bool TagsDialog::Validate()
{
   wxString errorString =
      _("Maximum length of attribute '%s' is %d characters. Data was truncated.");

   if(!mTags->mID3V2)
   {
      if(mTags->mTitle.Length() > 30)
      {
         wxMessageBox(wxString::Format(errorString, _("Title"), 30));

         mTags->mTitle = mTags->mTitle.Left(30);
         TransferDataToWindow();

         return FALSE;
      }

      if(mTags->mArtist.Length() > 30)
      {
         wxMessageBox(wxString::Format(errorString, _("Artist"), 30));

         mTags->mArtist = mTags->mArtist.Left(30);
         TransferDataToWindow();

         return FALSE;
      }

      if(mTags->mAlbum.Length() > 30)
      {
         wxMessageBox(wxString::Format(errorString, _("Album"), 30));

         mTags->mAlbum = mTags->mAlbum.Left(30);
         TransferDataToWindow();

         return FALSE;
      }

      if(mTags->mYear.Length() > 4)
      {
         wxMessageBox(wxString::Format(errorString, _("Year"), 4));

         mTags->mYear = mTags->mYear.Left(4);
         TransferDataToWindow();

         return FALSE;
      }

      if(mTags->mComments.Length() > 30)
      {
         wxMessageBox(wxString::Format(errorString, _("Comments"), 30));

         mTags->mComments = mTags->mComments.Left(30);
         TransferDataToWindow();

         return FALSE;
      }
   }

   return TRUE;
}
Ejemplo n.º 3
0
void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event))
{
    // We no longer query GetPrintMode, so we can eliminate the need
    // to call SetPrintMode.
    // This has the limitation that we can't explicitly call the PostScript
    // print setup dialog from the generic Page Setup dialog under Windows,
    // but since this choice would only happen when trying to do PostScript
    // printing under Windows (and only in 16-bit Windows which
    // doesn't have a Windows-specific page setup dialog) it's worth it.

    // First save the current settings, so the wxPrintData object is up to date.
    TransferDataFromWindow();

    // Transfer the current print settings from this dialog to the page setup dialog.

#if 0
    // Use print factory later

    wxPrintDialogData data;
    data = GetPageSetupData().GetPrintData();
    data.SetSetupDialog(true);
    wxPrintDialog printDialog(this, & data);
    printDialog.ShowModal();

    // Transfer the page setup print settings from the page dialog to this dialog again, in case
    // the page setup dialog changed something.
    GetPageSetupData().GetPrintData() = printDialog.GetPrintDialogData().GetPrintData();
    GetPageSetupData().CalculatePaperSizeFromId(); // Make sure page size reflects the id in wxPrintData

    // Now update the dialog in case the page setup dialog changed some of our settings.
    TransferDataToWindow();
#endif
}
Ejemplo n.º 4
0
void TileDlg::UpdateInfo()
{
	m_iTotalX = m_iLOD0Size * m_iColumns;
	m_iTotalY = m_iLOD0Size * m_iRows;
	if (m_bElev)
	{
		// Elevation is handled as grid corners, imagery is handled as
		//  centers, so grid sizes are differnt
		m_iTotalX ++;
		m_iTotalY ++;
	}

	m_fAreaX = m_area.Width();
	m_fAreaY = m_area.Height();

	if (m_bElev)
	{
		m_fCurX = m_fAreaX / (m_iTotalX - 1);
		m_fCurY = m_fAreaY / (m_iTotalY - 1);
	}
	else
	{
		m_fCurX = m_fAreaX / m_iTotalX;
		m_fCurY = m_fAreaY / m_iTotalY;
	}

	m_bSetting = true;
	TransferDataToWindow();
	m_bSetting = false;
}
Ejemplo n.º 5
0
void udDiagramDialog::OnInit(wxInitDialogEvent& event)
{
	// set validators
	m_eName->SetValidator(wxGenericValidator(&m_Name));
	m_eDescription->SetValidator(wxGenericValidator(&m_Description));
	m_cbGenerate->SetValidator(wxGenericValidator(&m_GenerateCode));
	
	// initialize controls
	bool fSubmachine = (m_pDiagram->GetSubdiagramElement() != NULL);
	
	m_fpOutputFile->Enable( !fSubmachine ); 
	m_chGenerator->Enable( !fSubmachine ); 
	//m_chAlgorithm->Enable( !fSubmachine );
	
	// initialize choices
	udFRAME::FillGeneratorsChoice( m_chGenerator, m_pLanguage, m_pDiagram );
	
	//udGenerator *pGen = wxGetApp().GetMainFrame()->CreateSelectedGenerator();	
	udGenerator *pGen = udPROJECT::CreateGenerator( m_chGenerator->GetStringSelection() );	
    if(pGen)
    {
		udFRAME::FillAlgorithmsChoice( m_chAlgorithm, m_pLanguage, m_pDiagram, pGen );
		delete pGen;
	}
	
	// initialize other controls
	m_fpOutputFile->SetPath( m_OutputFile );
	
	// use validators to transfer a dataOnGeneratorChange
	TransferDataToWindow();
	m_pageAdv->TransferDataToWindow();
	m_pageGen->TransferDataToWindow();
}
t4p::VersionUpdatePreferencesPanelClass::VersionUpdatePreferencesPanelClass(wxWindow* parent,
        t4p::PreferencesClass& preferences)
    : VersionUpdatePreferencesGeneratedPanelClass(parent, wxID_ANY) {
    wxGenericValidator checkValidator(&preferences.CheckForUpdates);
    CheckForUpdates->SetValidator(checkValidator);
    TransferDataToWindow();
}
Ejemplo n.º 7
0
void DialogDummyVideo::OnResolutionShortcut(wxCommandEvent &e) {
	TransferDataFromWindow();
	int rs = e.GetSelection();
	width = resolutions[rs].width;
	height = resolutions[rs].height;
	TransferDataToWindow();
}
void DIALOG_EESCHEMA_OPTIONS::OnDeleteButtonClick( wxCommandEvent& event )
{
    // wxGrid has a somewhat complex way of detemining selection.
    // This is pretty much the easiest way to do it, here.

    std::vector<bool> rows_to_delete( templateFields.size(), false );

    for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row )
    {
        for( int col = 0; col < m_fieldGrid->GetNumberCols(); ++col )
        {
            if( m_fieldGrid->IsInSelection( row, col ) )
                rows_to_delete[row] = true;
        }
    }

    TransferDataFromWindow();

    int n_rows = m_fieldGrid->GetNumberRows();
    for( int count = 0; count < n_rows; ++count )
    {
        // Iterate backwards, unsigned-friendly way for future
        int row = n_rows - count - 1;
        if( rows_to_delete[row] )
        {
            templateFields.erase( templateFields.begin() + row );
        }
    }

    TransferDataToWindow();
}
Ejemplo n.º 9
0
bool AudacityCommand::SetAutomationParameters(const wxString & parms)
{
   wxString preset = parms;

   CommandParameters eap(parms);
   ShuttleSetAutomation S;

   S.SetForWriting( &eap );
   bool bResult = DefineParams( S );
   wxASSERT_MSG( bResult, "You did not define DefineParameters() for this command" );
   static_cast<void>(bResult); // fix unused variable warning in release mode
   if (!S.bOK)
   {
      AudacityCommand::MessageBox(
         wxString::Format(
            _("%s: Could not load settings below. Default settings will be used.\n\n%s"),
            GetTranslatedName(),
            preset
         )
      );

      // fror now always succeed, so that we can prompt the user.
      return true;
   }

   return TransferDataToWindow();
}
//!
//! @param settings - Object to load settings from
//!
void AdvancedPanel::loadSettings(const AppSettings &settings) {

   print("AdvancedPanel::loadSettings()\n");

//   Init();

   bdmOptions.powerOffDuration         = settings.getValue(powerOffDurationKey,        bdmOptions.powerOffDuration);
   bdmOptions.powerOnRecoveryInterval  = settings.getValue(powerOnRecoveryIntervalKey, bdmOptions.powerOnRecoveryInterval);
   bdmOptions.resetDuration            = settings.getValue(resetDurationKey,           bdmOptions.resetDuration);
   bdmOptions.resetReleaseInterval     = settings.getValue(resetReleaseIntervalKey,    bdmOptions.resetReleaseInterval);
   bdmOptions.resetRecoveryInterval    = settings.getValue(resetRecoveryIntervalKey,   bdmOptions.resetRecoveryInterval);

#if (TARGET==CFV1) || (TARGET==ARM) || (TARGET==ARM_SWD)
   int eepromSize = settings.getValue(eeepromSizeKey,             0);
   eeepromSizeChoice = findEeepromSizeIndex(eepromSize);
   if (eeepromSizeChoice == 0) {
      flexNvmPartitionIndex = 0;
   }
   else {
      int partitionSize = settings.getValue(flexNvmPartitionSizeKey,        0);
      flexNvmPartitionIndex = findPartitionControlIndex(partitionSize);
   }
#endif
   TransferDataToWindow();
}
Ejemplo n.º 11
0
void wxGxObjectDialog::OnItemSelected(wxListEvent& event)
{
	event.Skip();
    //if(m_bIsSaveDlg)
    //    return;

    wxGxDialogContentView::LPITEMDATA pItemData = (wxGxDialogContentView::LPITEMDATA)event.GetData();
	if(pItemData == NULL)
		return;

	wxGxObject* pGxObject = m_pCatalog->GetRegisterObject(pItemData->nObjectID);
    bool bIsDataset = pGxObject->IsKindOf(wxCLASSINFO(wxGxDataset)) || m_FilterArray[m_WildcardCombo->GetCurrentSelection()]->CanChooseObject(pGxObject);
    bool bIsObjContainer = pGxObject->IsKindOf(wxCLASSINFO(wxGxObjectContainer));
    if(!bIsDataset && bIsObjContainer)
    {
        return;
    }

    wxString sTempName;
	long item = wxNOT_FOUND;
	while(1)
    {
        item = m_pwxGxContentView->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if ( item == wxNOT_FOUND )
            break;
		if(sTempName.IsEmpty())
			sTempName += m_pwxGxContentView->GetItemText(item);
		else
			sTempName += wxT("; ") + m_pwxGxContentView->GetItemText(item);
    }
	if(!sTempName.IsEmpty())
        m_sName = sTempName;
	TransferDataToWindow();
}
Ejemplo n.º 12
0
void TimeDialog::PopulateOrExchange(ShuttleGui &S)
{
   S.SetBorder(5);
   S.StartVerticalLay(true);
   {
      S.StartStatic(mPrompt, true);
      {
         mTimeCtrl = new
            TimeTextCtrl(this,
                         wxID_ANY,
                         wxT(""),
                         mTime,
                         mRate,
                         wxDefaultPosition,
                         wxDefaultSize,
                         true);
         mTimeCtrl->SetName(mPrompt);
         mTimeCtrl->SetFormatString(mTimeCtrl->GetBuiltinFormat(mFormat));
         S.AddWindow(mTimeCtrl);
         mTimeCtrl->EnableMenu();
      }
      S.EndStatic();
   }
   S.EndVerticalLay();
   S.AddStandardButtons();

   TransferDataToWindow();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();
}
Ejemplo n.º 13
0
void UtilDlg::OnInitDialog(wxInitDialogEvent& event)
{
	VTLOG("UtilDlg looking for items of type utility pole.\n");
	vtContentManager &mng = vtGetContent();

	int found = 0;
	m_pChoice->Clear();
	for (uint i = 0; i < mng.NumItems(); i++)
	{
		vtString str;
		vtItem *item = mng.GetItem(i);
		if (item->GetValueString("type", str))
		{
			if (str == "utility pole")
			{
				m_pChoice->Append(wxString::FromAscii(item->m_name));
				found++;
			}
		}
	}
	TransferDataToWindow();

	VTLOG("\t%d items, %d found.\n", mng.NumItems(), found);

	wxString val = m_pChoice->GetStringSelection();
	g_App.SetPowerOptions((const char *) val.mb_str(wxConvUTF8));
}
Ejemplo n.º 14
0
void AvcCompressorDialog::ReadPrefs()
{
	int			nTemp;
	bool		bTemp;
	wxString	strTemp;

	nTemp = gPrefs->Read ( PREF_ADJWIN, ADJWIN_DEFAULT );
	mstrAdjWin.Printf("%d", nTemp);
	nTemp = gPrefs->Read ( PREF_DELAY, DELAY_DEFAULT );
	mstrDelay.Printf("%d", nTemp);
	nTemp = gPrefs->Read ( PREF_CHANGE, CHANGE_DEFAULT );
	mstrChangeWin.Printf("%d", nTemp);
	nTemp = gPrefs->Read ( PREF_MINPCT, MINPCT_DEFAULT );
	mstrMinPct.Printf("%d", nTemp);

	for ( int i = 1 ; i < NUM_CURVE_POINTS - 1 ; ++ i ) {
		strTemp.Printf(PREF_ENABLE,i);
		bTemp = ( gPrefs->Read ( strTemp, true ) == 0 ) ? false : true;
		mctlCheckBoxes[i]->SetValue(bTemp);
		mctlXAxis[i]->Show ( bTemp );
		mctlYAxis[i]->Show ( bTemp );

		strTemp.Printf(PREF_HORIZ,i);
		nTemp = gPrefs->Read ( strTemp, naSampleChoicesHoriz[4][i] );
		mstrXAxis[i].Printf( "%d", nTemp );
		strTemp.Printf(PREV_VERT,i);
		nTemp = gPrefs->Read ( strTemp, naSampleChoicesVert[4][i] );
		mstrYAxis[i].Printf( "%d", nTemp );
	}
	TransferDataToWindow();
}
Ejemplo n.º 15
0
void LabelDialog::OnRemove(wxCommandEvent &event)
{
   int row = mGrid->GetCursorRow();
   int col = mGrid->GetCursorColumn();
   int cnt = mData.GetCount();

   // Don't try to remove if no labels exist
   if (cnt == 0) {
      return;
   }

   // Make sure the edit control isn't active before removing rows
   if (mGrid->IsCellEditControlShown()) {
      mGrid->HideCellEditControl();
   }

   // Remove the row
   RowData *rd = mData[row];
   mData.RemoveAt(row);
   delete rd;

   // Repopulate the grid
   TransferDataToWindow();

   // Reposition the cursor
   if (row > 0 && row >= --cnt) {
      row--;
   }
   mGrid->SetGridCursor(row, col);
}
Ejemplo n.º 16
0
void PropPanel::SetCurrentItem(vtItem *item)
{
	if (item)
	{
		m_strItem = wxString(item->m_name, wxConvUTF8);
		const char *type = item->GetValueString("type");
		if (type)
			m_strType = wxString(type, wxConvUTF8);
		else
			m_strType = _T("unknown");
		const char *subtype = item->GetValueString("subtype");
		if (subtype)
			m_strSubtype = wxString(subtype, wxConvUTF8);
		else
			m_strSubtype = _T("");
	}
	else
	{
		m_strItem = _T("");
		m_strType = _("unspecified");
	}
	m_pCurrentItem = item;

	m_bUpdating = true;
	TransferDataToWindow();
	int sel = m_pTypeChoice->FindString(m_strType);
	if (sel != -1)
		m_pTypeChoice->SetSelection(sel);
	else
		m_pTypeChoice->SetSelection(0);
	UpdateSubtypes();
	UpdateTagList();
	m_bUpdating = false;
}
DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ) :
    DIALOG_PAD_PROPERTIES_BASE( aParent ),
    m_OrientValidator( 1, &m_OrientValue )
{
    m_canUpdate  = false;
    m_parent     = aParent;
    m_currentPad = aPad;        // aPad can be NULL, if the dialog is called
                                // from the footprint editor to set default pad setup

    m_board      = m_parent->GetBoard();

    m_OrientValidator.SetRange( -360.0, 360.0 );
    m_PadOrientCtrl->SetValidator( m_OrientValidator );
    m_OrientValidator.SetWindow( m_PadOrientCtrl );

    m_padMaster  = &m_parent->GetDesignSettings().m_Pad_Master;
    m_dummyPad   = new D_PAD( (MODULE*) NULL );

    if( aPad )
        *m_dummyPad = *aPad;
    else    // We are editing a "master" pad, i.e. a template to create new pads
        *m_dummyPad = *m_padMaster;

    // Show the X and Y axis. It is usefull because pad shape can have an offset
    // or be a complex shape.
    m_axisOrigin = new KIGFX::ORIGIN_VIEWITEM( KIGFX::COLOR4D(0.0, 0.0, 0.8, 1.0),
                                               KIGFX::ORIGIN_VIEWITEM::CROSS,
                                               Millimeter2iu( 0.2 ),
                                               VECTOR2D( m_dummyPad->GetPosition() ) );
    m_axisOrigin->SetDrawAtZero( true );

    if( m_parent->IsGalCanvasActive() )
    {
        m_panelShowPadGal->UseColorScheme( m_board->GetColorsSettings() );
        m_panelShowPadGal->SwitchBackend( m_parent->GetGalCanvas()->GetBackend() );
        m_panelShowPadGal->Show();
        m_panelShowPad->Hide();
        m_panelShowPadGal->GetView()->Add( m_dummyPad );
        m_panelShowPadGal->GetView()->Add( m_axisOrigin );
        m_panelShowPadGal->StartDrawing();
        Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PROPERTIES::OnResize ) );
    }
    else
    {
        m_panelShowPad->Show();
        m_panelShowPadGal->Hide();
    }

    initValues();
    TransferDataToWindow();

    m_sdbSizerOK->SetDefault();
    m_PadNumCtrl->SetFocus();
    m_canUpdate = true;

    FixOSXCancelButtonIssue();

    // Now all widgets have the size fixed, call FinishDialogSettings
    FinishDialogSettings();
}
    void OnInitDlg( wxInitDialogEvent& event )
    {
        // Call the default wxDialog handler of a wxInitDialogEvent
        TransferDataToWindow();

        // Now all widgets have the size fixed, call FinishDialogSettings
        FinishDialogSettings();
    }
Ejemplo n.º 19
0
void LabelDialog::OnUpdate(wxCommandEvent &event)
{
   // Remember the new format and repopulate grid
   mFormat = event.GetString();
   TransferDataToWindow();

   event.Skip(false);
}
Ejemplo n.º 20
0
void DialogJumpTo::OnInitDialog(wxInitDialogEvent&) {
	TransferDataToWindow();
	UpdateWindowUI(wxUPDATE_UI_RECURSE);

	// This can't simply be done in the constructor as the value hasn't been set yet
	JumpFrame->SetFocus();
	JumpFrame->SelectAll();
}
void DIALOG_EESCHEMA_OPTIONS::SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields )
{
    // Set the template fields object
    templateFields = aFields;

    // Build and refresh the view
    TransferDataToWindow();
}
Ejemplo n.º 22
0
ExportFLACOptions::ExportFLACOptions(wxWindow *parent, int WXUNUSED(format))
:  wxPanel(parent, wxID_ANY)
{
   ShuttleGui S(this, eIsCreatingFromPrefs);
   PopulateOrExchange(S);

   TransferDataToWindow();
}
Ejemplo n.º 23
0
void SampleImageDlg::OnSmaller( wxCommandEvent &event )
{
	m_power--;
	RecomputeSize();

	m_bSetting = true;
	TransferDataToWindow();
	m_bSetting = false;
}
Ejemplo n.º 24
0
void SampleImageDlg::OnRadioOutput( wxCommandEvent &event )
{
	TransferDataFromWindow();
	EnableBasedOnConstraint();
	RecomputeSize();

	m_bSetting = true;
	TransferDataToWindow();
	m_bSetting = false;
}
Ejemplo n.º 25
0
void wxGISFeatureDetailsPanel::SetClickPositionText(const OGRPoint *pPt)
{
    if(!pPt)
        return;
    //TODO: OGRPoint has spatial reference. This should be used in m->deg and vice versa transform
	m_dfX = pPt->getX();
	m_dfY = pPt->getY();
	m_sLocation = m_pCFormat->Format(m_dfX, m_dfY);
	TransferDataToWindow();
}
Ejemplo n.º 26
0
ExportOGGOptions::ExportOGGOptions(wxWindow *parent, int WXUNUSED(format))
:  wxPanelWrapper(parent, wxID_ANY)
{
   mOggQualityUnscaled = gPrefs->Read(wxT("/FileFormats/OggExportQuality"),50)/10;

   ShuttleGui S(this, eIsCreatingFromPrefs);
   PopulateOrExchange(S);

   TransferDataToWindow();
}
Ejemplo n.º 27
0
	MountOptionsDialog::MountOptionsDialog (wxWindow *parent, MountOptions &options, const wxString &title, bool disableMountOptions)
		: MountOptionsDialogBase (parent, wxID_ANY, wxString()
#ifdef __WXGTK__ // GTK apparently needs wxRESIZE_BORDER to support dynamic resizing
		, wxDefaultPosition, wxSize (-1,-1), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
#endif
		), Options (options)
	{
		if (!title.empty())
			this->SetTitle (title);
		else if (options.Path && !options.Path->IsEmpty())
			this->SetTitle (StringFormatter (LangString["ENTER_PASSWORD_FOR"], wstring (*options.Path)));
		else
			this->SetTitle (LangString["ENTER_TC_VOL_PASSWORD"]);

		if (disableMountOptions)
			OptionsButton->Show (false);

		PasswordPanel = new VolumePasswordPanel (this, &options, options.Password, disableMountOptions, options.Keyfiles, !disableMountOptions, true, true, false, true, true);
		PasswordPanel->SetCacheCheckBoxValidator (wxGenericValidator (&Options.CachePassword));

		PasswordSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);

#ifdef __WXGTK__
		FilesystemOptionsSizer->Remove (FilesystemSpacer);
		OptionsPanel->Show (false);
		Fit();
		Layout();
		SetMinSize (GetSize());
#endif

		NoFilesystemCheckBox->SetValidator (wxGenericValidator (&Options.NoFilesystem));
		RemovableCheckBox->SetValidator (wxGenericValidator (&Options.Removable));
		PartitionInSystemEncryptionScopeCheckBox->SetValidator (wxGenericValidator (&Options.PartitionInSystemEncryptionScope));

		TransferDataToWindow();

		if (Options.MountPoint && !Options.MountPoint->IsEmpty())
			 MountPointTextCtrl->SetValue (wstring (*Options.MountPoint));

		FilesystemOptionsTextCtrl->SetValue (Options.FilesystemOptions);

		ReadOnlyCheckBox->SetValue (Options.Protection == VolumeProtection::ReadOnly);
		ProtectionCheckBox->SetValue (Options.Protection == VolumeProtection::HiddenVolumeReadOnly);

		OptionsButtonLabel = OptionsButton->GetLabel();
		OptionsButton->SetLabel (OptionsButtonLabel + L" >");
		OptionsPanel->Show (false);

		ProtectionPasswordPanel = new VolumePasswordPanel (OptionsPanel, &options, options.ProtectionPassword, true, options.ProtectionKeyfiles, false, true, true, false, true, true, _("P&assword to hidden volume:"));
		ProtectionPasswordSizer->Add (ProtectionPasswordPanel, 1, wxALL | wxEXPAND);

		UpdateDialog();
		Center();
	}
Ejemplo n.º 28
0
void udEnumElementDialog::OnInit(wxInitDialogEvent& event)
{
	// set validators
	m_eName->SetValidator(wxGenericValidator(&m_Name));
	m_eDescription->SetValidator(wxGenericValidator(&m_Description));
	m_eValue->SetValidator(wxGenericValidator(&m_Value));
	
	// use validators to transfer a data
	TransferDataToWindow();
	m_pageAdv->TransferDataToWindow();
}
Ejemplo n.º 29
0
void CPropertyDlg::OnPickPath( wxCommandEvent& event )
{
    wxDirDialog dlg( this, _("Choose a directory to save file"), m_sSavePath, wxDD_NEW_DIR_BUTTON );

    if ( dlg.ShowModal() == wxID_OK )
    {
        TransferDataFromWindow();
        m_sSavePath = dlg.GetPath();
        TransferDataToWindow();
    }
}
Ejemplo n.º 30
0
TileDlg::TileDlg( wxWindow *parent, wxWindowID id, const wxString &title,
	const wxPoint &position, const wxSize& size, long style ) :
	TileDlgBase( parent, id, title, position, size, style )
{
	m_fEstX = -1;
	m_fEstY = -1;
	m_iColumns = 1;
	m_iRows = 1;

	m_bSetting = false;
	m_pView = NULL;
	m_bElev = false;

	m_bCompressNone = true;
	m_bCompressOGL = false;
	m_bCompressSquishFast = false;
	m_bCompressSquishSlow = false;
	m_bCompressJPEG = false;

	AddValidator(this, ID_TEXT_TO_FOLDER, &m_strToFile);
	AddNumValidator(this, ID_COLUMNS, &m_iColumns);
	AddNumValidator(this, ID_ROWS, &m_iRows);
	AddValidator(this, ID_CHOICE_LOD0_SIZE, &m_iLODChoice);
	AddValidator(this, ID_SPIN_NUM_LODS, &m_iNumLODs);

	// informations
	AddNumValidator(this, ID_TOTALX, &m_iTotalX);
	AddNumValidator(this, ID_TOTALY, &m_iTotalY);

	AddNumValidator(this, ID_AREAX, &m_fAreaX);
	AddNumValidator(this, ID_AREAY, &m_fAreaY);

	AddNumValidator(this, ID_ESTX, &m_fEstX);
	AddNumValidator(this, ID_ESTY, &m_fEstY);

	AddNumValidator(this, ID_CURX, &m_fCurX);
	AddNumValidator(this, ID_CURY, &m_fCurY);

	AddValidator(this, ID_OMIT_FLAT, &m_bOmitFlatTiles);
	AddValidator(this, ID_MASK_UNKNOWN, &m_bMaskUnknown);
	AddValidator(this, ID_TEXTURE_ALPHA, &m_bImageAlpha);

	AddValidator(this, ID_TC_NONE, &m_bCompressNone);
	AddValidator(this, ID_TC_OGL, &m_bCompressOGL);
	AddValidator(this, ID_TC_SQUISH_FAST, &m_bCompressSquishFast);
	AddValidator(this, ID_TC_SQUISH_SLOW, &m_bCompressSquishSlow);
	AddValidator(this, ID_TC_JPEG, &m_bCompressJPEG);

	UpdateEnables();

	TransferDataToWindow();

	GetSizer()->SetSizeHints(this);
}