void LocationSetPropertiesDlg::InitLocationSetColour() { // populate combo box with all fields associated with a location std::vector<std::wstring> fields = m_locationSetController->GetMetadataFields(); std::vector<std::wstring>::iterator it; for(it = fields.begin(); it != fields.end(); ++it) { m_cboColourField->Append(wxString((*it).c_str())); } if(!m_locationSetController->GetColourField().empty()) m_cboColourField->SetValue(m_locationSetController->GetColourField().c_str()); else { if(!m_cboColourField->IsEmpty()) m_cboColourField->SetValue(m_cboColourField->GetString(0)); } // Populate colour map combo box with all available colour maps m_colourMapWidget->SetColourMap(m_locationSetController->GetColourMap()); m_colourMapWidget->PopulateColourMapComboBox(); // Set field values wxCommandEvent dummy; OnColourFieldChange(dummy); Colour uniColour = m_locationSetController->GetUniformColour(); m_colourUniform->SetColour(wxColour(uniColour.GetRedInt(), uniColour.GetGreenInt(), uniColour.GetBlueInt())); ReplaceColourPicker( m_colourUniform, uniColour ); // Set uniform colour checkbox and colour if(!m_locationSetController->ModifiedColour()) { m_chkUniformColour->SetValue(m_locationSetController->GetUniformColourFlag()); wxCommandEvent dummy; OnUniformColour(dummy); } else { m_chkUniformColour->Set3StateValue(wxCHK_UNDETERMINED); #ifdef WIN32 m_colourUniform->Enable(false); #else EnableButton( m_colourUniform, false ); #endif m_scrolledWindowColour->Enable(false); m_cboColourField->Enable(false); m_cboColourMap->Enable(false); } m_spinBorderSize->SetValue(m_locationSetController->GetBorderSize()); Colour borderColour = m_locationSetController->GetBorderColour(); m_colourBorders->SetColour(wxColour(borderColour.GetRedInt(), borderColour.GetGreenInt(), borderColour.GetBlueInt())); ReplaceColourPicker( m_colourBorders, borderColour ); }
void LocationPropertiesDlg::InitSymbology() { LocationViewPtr locationView = m_locationLayer->GetLocationController()->GetLocationView(); Colour colour = locationView->GetColour(); m_colourSymbol->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt(), colour.GetAlphaInt())); ReplaceColourPicker( m_colourSymbol, colour ); m_txtSymbolSize->SetValue(wxString(StringTools::ToStringW(locationView->GetSize(), 2).c_str())); VisualMarker::MARKER_SHAPE shape = locationView->GetShape(); if(shape == VisualMarker::CIRCLE) m_cboSymbolShape->SetValue(_T("Circle")); else if(shape == VisualMarker::CIRCLE_FAST) m_cboSymbolShape->SetValue(_T("Circle (fast)")); else if(shape == VisualMarker::SQUARE) m_cboSymbolShape->SetValue(_T("Square")); else if(shape == VisualMarker::TRIANGLE) m_cboSymbolShape->SetValue(_T("Triangle")); else if(shape == VisualMarker::STAR) m_cboSymbolShape->SetValue(_T("Star")); else if(shape == VisualMarker::PLUS_SIGN) m_cboSymbolShape->SetValue(_T("Plus sign")); else if(shape == VisualMarker::OCTAGON) m_cboSymbolShape->SetValue(_T("Octagon")); else if(shape == VisualMarker::DIAMOND) m_cboSymbolShape->SetValue(_T("Diamond")); else if(shape == VisualMarker::INVERTED_TRIANGLE) m_cboSymbolShape->SetValue(_T("Inverted triangle")); VisualLabelPtr label = locationView->GetLabel(); m_spinLabelSize->SetValue(label->GetSize()); m_cboLabelPosition->SetValue(wxString(label->GetLabelPosition().c_str())); m_cboLabelStyle->SetValue(wxString(label->GetLabelStyle().c_str())); colour = label->GetColour(); m_colourLabel->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); ReplaceColourPicker( m_colourLabel, colour ); m_chkLabelVisible->SetValue(label->IsVisible()); m_chkLocationVisible->SetValue(locationView->IsVisible()); }
void StudyPropertiesDlg::Init() { // set the title of the properties dialog this->SetLabel( wxString(m_studyLayer->GetName().c_str()) + wxT( " : Study Properties" ) ); // set state of controls on General page m_txtLayerName->SetValue(wxString(m_studyLayer->GetName().c_str())); m_txtLayerDescription->SetValue(wxString(m_studyLayer->GetDescription().c_str())); m_txtAuthours->SetValue(wxString(m_studyLayer->GetAuthours().c_str())); // set state of controls on Projection page StudyControllerPtr studyController = m_studyLayer->GetStudyController(); m_cboDatum->SetValue(wxString(studyController->GetDatum().c_str())); m_cboProjection->SetValue(wxString(studyController->GetProjection().c_str())); // set state of controls on Symbology page Colour bgColour = App::Inst().GetViewport()->GetBackgroundColour(); m_colourBackground->SetColour(wxColour(bgColour.GetRedInt(), bgColour.GetGreenInt(), bgColour.GetBlueInt())); #ifndef WIN32 m_colourBackground->Hide(); CustomColourButton* customColourButton = new CustomColourButton( m_colourBackground->GetParent(), m_colourBackground, wxColour(bgColour.GetRedInt(), bgColour.GetGreenInt(), bgColour.GetBlueInt()) ); wxSizer* colourIconSizer = m_colourBackground->GetContainingSizer(); colourIconSizer->Replace( m_colourBackground, customColourButton ); colourIconSizer->Layout(); customColourButton->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( StudyPropertiesDlg::OnCustomColourButtonClicked ), NULL, this ); #endif int maxTerrainResolution = App::Inst().GetViewport()->GetMaxTerrainResolution(); if (maxTerrainResolution == 256) m_cboTerrainResolution->SetValue(_T("256")); else if (maxTerrainResolution == 512) m_cboTerrainResolution->SetValue(_T("512")); else if (maxTerrainResolution == 1024) m_cboTerrainResolution->SetValue(_T("1024")); else if (maxTerrainResolution == 2048) m_cboTerrainResolution->SetValue(_T("2048")); else if (maxTerrainResolution == 4096) m_cboTerrainResolution->SetValue(_T("4096")); else if (maxTerrainResolution == 8196) m_cboTerrainResolution->SetValue(_T("8196")); }
void TreePropertiesDlg::ReplaceColourPicker( wxColourPickerCtrl* wxColourPicker, Colour& colour ) { #ifndef WIN32 wxColourPicker->Hide(); CustomColourButton* customColourButton = new CustomColourButton( wxColourPicker->GetParent(), wxColourPicker, wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt()) ); wxSizer* colourIconSizer = wxColourPicker->GetContainingSizer(); colourIconSizer->Replace( wxColourPicker, customColourButton ); colourIconSizer->Layout(); customColourButton->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( TreePropertiesDlg::OnCustomColourButtonClicked ), NULL, this ); #endif }
void LocationSetPropertiesDlg::InitChart() { wxBusyCursor wait; ChartViewPtr chartView = m_locationSetLayer->GetLocationLayer(0)->GetLocationController()->GetChartView(); // populate field combo box with all possible fields if(App::Inst().GetLayerTreeController()->GetNumSequenceLayers() > 0) { // populate combo box with all fields associated with a sequence std::map<std::wstring,std::wstring> data = m_locationSetController->GetSequenceMetadata(); std::map<std::wstring,std::wstring>::iterator it; for(it = data.begin(); it != data.end(); ++it) { if(StringTools::ToLower((*it).first.c_str()) != _T("site id") && StringTools::ToLower((*it).first.c_str()) != _T("sequence id")) { m_cboChartField->Append(wxString((*it).first.c_str())); } } foreach(const std::wstring& field, App::Inst().GetLayerTreeController()->GetSequenceLayer(0)->GetSequenceController()->GetNumericMetadataFields()) m_cboQuantitativeField->Append(wxString(field.c_str())); if(!chartView->GetField().empty()) m_cboChartField->SetValue(wxString(chartView->GetField().c_str())); else { if(!m_cboChartField->IsEmpty()) m_cboChartField->SetValue(m_cboChartField->GetString(0)); } if(!chartView->GetQuantitativeField().empty()) m_cboQuantitativeField->SetValue(wxString(chartView->GetQuantitativeField().c_str())); else { if(!m_cboQuantitativeField->IsEmpty()) m_cboQuantitativeField->SetValue(m_cboQuantitativeField->GetString(0)); } // Populate colour map combo box with all available colour maps m_chartColourMapWidget->SetColourMap(chartView->GetColourMap()); m_chartColourMapWidget->PopulateColourMapComboBox(); // Set all controls if(chartView->GetChartType() == ChartView::PIE_CHART_2D) { m_chkChart2D->SetValue(true); m_cboChartType->SetValue(wxT("Pie Chart")); } else if(chartView->GetChartType() == ChartView::PIE_CHART_3D) { m_chkChart2D->SetValue(false); m_cboChartType->SetValue(wxT("Pie Chart")); } else if(chartView->GetChartType() == ChartView::BAR_CHART_2D) { m_chkChart2D->SetValue(true); m_cboChartType->SetValue(wxT("Bar Chart")); } else if(chartView->GetChartType() == ChartView::BAR_CHART_3D) { m_chkChart2D->SetValue(false); m_cboChartType->SetValue(wxT("Bar Chart")); } m_spinChartWidth->SetValue((int)chartView->GetWidth()); m_spinChartHeight->SetValue((int)chartView->GetHeight()); m_spinChartBorderSize->SetValue((int)chartView->GetBorderSize()); m_chkShowElementBorders->SetValue(chartView->GetWedgeBorders()); m_chkBottomBorder->SetValue(chartView->IsBottomBorder()); m_chkLeftBorder->SetValue(chartView->IsLeftBorder()); m_chkTopBorder->SetValue(chartView->IsTopBorder()); m_chkRightBorder->SetValue(chartView->IsRightBorder()); Colour bgColour = chartView->GetBackgroundColour(); m_colourChartBackground->SetColour(wxColour(bgColour.GetRedInt(), bgColour.GetGreenInt(), bgColour.GetBlueInt())); ReplaceColourPicker( m_colourChartBackground, bgColour ); if(bgColour.GetAlphaInt() == 0) m_chkTransparentBackground->SetValue(true); else m_chkTransparentBackground->SetValue(false); Colour borderColour = chartView->GetBorderColour(); m_colourChartBorder->SetColour(wxColour(borderColour.GetRedInt(), borderColour.GetGreenInt(), borderColour.GetBlueInt())); ReplaceColourPicker( m_colourChartBorder, borderColour ); m_chkAssignLocationColour->SetValue(chartView->IsAssignBorderLocationColour()); m_chkShowCharts->SetValue(chartView->IsVisible()); m_chkChartSizeBySeqCount->SetValue(chartView->GetSizeProportionalToSeq()); m_txtChartMinSize->SetValue(wxString(StringTools::ToStringW(chartView->GetMinSize()).c_str())); m_txtChartMaxSize->SetValue(wxString(StringTools::ToStringW(chartView->GetMaxSize()).c_str())); m_spinChartFilterTaxaPercentage->SetValue((int)chartView->GetAssignToOther()); m_spinChartDropLineThickness->SetValue(chartView->GetDropLines()->GetThickness()); Colour colour = chartView->GetDropLines()->GetColour(); m_colourChartDropLine->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt(), colour.GetAlphaInt())); ReplaceColourPicker( m_colourChartDropLine, colour ); if(chartView->GetDropLines()->GetStyle() == VisualLine::SOLID) m_cboChartDropLineStyle->SetValue(_T("Solid")); else if(chartView->GetDropLines()->GetStyle() == VisualLine::SHORT_DASH) m_cboChartDropLineStyle->SetValue(_T("Short dash")); else if(chartView->GetDropLines()->GetStyle() == VisualLine::LONG_DASH) m_cboChartDropLineStyle->SetValue(_T("Long dash")); else if(chartView->GetDropLines()->GetStyle() == VisualLine::HIDDEN) m_cboChartDropLineStyle->SetValue(_T("Hidden")); m_chkQuantitative->SetValue(chartView->GetQuantitative()); // Set field values wxCommandEvent dummy; OnChartFieldChange(dummy); OnQuantitative(dummy); // enable all controls since there is sequence data m_cboChartField->Enable(); m_cboChartColourMap->Enable(); m_cboChartType->Enable(); m_spinChartWidth->Enable(); m_spinChartHeight->Enable(); m_spinChartBorderSize->Enable(); m_colourChartBorder->Enable(); m_chkAssignLocationColour->Enable(); m_chkShowElementBorders->Enable(); m_chkShowCharts->Enable(); m_cboChartDropLineStyle->Enable(); m_spinChartDropLineThickness->Enable(); #ifdef WIN32 m_colourChartDropLine->Enable(); #else EnableButton( m_colourChartDropLine, true ); #endif m_spinChartFilterTaxaPercentage->Enable(); m_chkChartSizeBySeqCount->Enable(); }
void LocationSetPropertiesDlg::InitLocationSetLabel() { // populate combo box with all fields associated with a location std::vector<std::wstring> fields = m_locationSetController->GetMetadataFields(); std::vector<std::wstring>::iterator it; for(it = fields.begin(); it != fields.end(); ++it) m_cboLabelField->Append(wxString((*it).c_str())); if(!m_locationSetController->GetColourField().empty()) m_cboLabelField->SetValue(m_locationSetController->GetLabelField().c_str()); else { if(!m_cboLabelField->IsEmpty()) m_cboLabelField->SetValue(m_cboLabelField->GetString(0)); } if(!m_locationSetController->ModifiedLabelSize()) m_spinFontSize->SetValue(m_locationSetController->GetLabelSize()); else m_spinFontSize->SetValue(-1); if(!m_locationSetController->ModifiedLabelColour()) { Colour colour = m_locationSetController->GetLabelColour(); m_colourLabel->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); ReplaceColourPicker( m_colourLabel, colour ); } else { Colour colour(0,0,0); m_colourLabel->SetColour(wxColour(0,0,0,0)); ReplaceColourPicker( m_colourLabel, colour ); } if(!m_locationSetController->ModifiedLabelPosition()) { m_cboLabelPosition->SetValue(wxString(m_locationSetController->GetLabelPosition().c_str())); } else { m_cboLabelPosition->Append(_T("<individually set>")); m_cboLabelPosition->SetValue(_T("<individually set>")); } if(!m_locationSetController->ModifiedLabelStyle()) { m_cboLabelStyle->SetValue(wxString(m_locationSetController->GetLabelStyle().c_str())); } else { m_cboLabelStyle->Append(_T("<individually set>")); m_cboLabelStyle->SetValue(_T("<individually set>")); } if(!m_locationSetController->ModifiedLabelVisibility()) { m_chkShowLabels->SetValue(m_locationSetController->GetLabelVisibility()); } else { m_chkShowLabels->Set3StateValue(wxCHK_UNDETERMINED); } m_chkBindToCharts->SetValue(m_locationSetController->GetLabelBindToChart()); wxCommandEvent dummy; OnShowLabels(dummy); }
void TreePropertiesDlg::Init() { // set the title of the properties dialog this->SetLabel( wxString(m_treeLayer->GetName().c_str()) + wxT( " : Tree Properties" ) ); // *** Set state of controls on General page m_txtLayerName->SetValue(wxString(m_treeLayer->GetName().c_str())); m_txtLayerDescription->SetValue(wxString(m_treeLayer->GetDescription().c_str())); m_txtAuthours->SetValue(wxString(m_treeLayer->GetAuthours().c_str())); // *** Set state of controls on Symbology page GeoTreeViewPtr geoTreeView = m_treeLayer->GetGeoTreeView(); // tree layout properties if(geoTreeView->GetLayout() == GeoTreeView::SLANTED_CLADOGRAM_3D) m_cboTreeLayout->SetValue(_T("3D slanted cladogram")); else if(geoTreeView->GetLayout() == GeoTreeView::CLADOGRAM_3D) m_cboTreeLayout->SetValue(_T("3D cladogram")); else if(geoTreeView->GetLayout() == GeoTreeView::SLANTED_PHYLOGRAM_3D) m_cboTreeLayout->SetValue(_T("3D slanted phylogram")); else if(geoTreeView->GetLayout() == GeoTreeView::CLADOGRAM_2D) m_cboTreeLayout->SetValue(_T("2D cladogram")); else if(geoTreeView->GetLayout() == GeoTreeView::PHYLOGRAM_2D) m_cboTreeLayout->SetValue(_T("2D phylogram")); else if(geoTreeView->GetLayout() == GeoTreeView::ELLIPSE_QUADRANT) m_cboTreeLayout->SetValue(_T("Elliptical Layout")); m_spinTreeThickness->SetValue(geoTreeView->GetLineThickness()); m_txtTreeHeight->SetValue(wxString::Format(wxT("%f"), geoTreeView->GetHeight())); if(geoTreeView->GetOrientation() == GeoTreeView::VERTICAL) m_cbo2dOrientation->SetValue(_T("Vertical")); else if(geoTreeView->GetOrientation() == GeoTreeView::HORIZONTAL) m_cbo2dOrientation->SetValue(_T("Horizontal")); m_chkDrawLayoutPrimative->SetValue(geoTreeView->GetLayoutPrimativeVisibility()); // tree style properties Colour treeColour = geoTreeView->GetColour(); m_colourTree->SetColour(wxColour(treeColour.GetRedInt(), treeColour.GetGreenInt(), treeColour.GetBlueInt(), treeColour.GetAlphaInt())); ReplaceColourPicker( m_colourTree, treeColour ); if(geoTreeView->GetTreeColourStyle() == GeoTreeView::COLOUR_SINGLE) m_cboTreeColourStyle->SetValue(_T("Single colour")); else if(geoTreeView->GetTreeColourStyle() == GeoTreeView::COLOUR_DISCRETE) m_cboTreeColourStyle->SetValue(_T("Propogate discrete colours")); else if(geoTreeView->GetTreeColourStyle() == GeoTreeView::COLOUR_CONTINUOUS) m_cboTreeColourStyle->SetValue(_T("Propogate continuous colours")); m_spinLeafNodeSize->SetValue(geoTreeView->GetLeafNodeSize()); m_spinInternalNodeSize->SetValue(geoTreeView->GetInternalNodeSize()); m_spinBranchBorderSize->SetValue(geoTreeView->GetBranchBorderSize()); m_spinLeafNodeBorderSize->SetValue(geoTreeView->GetLeafNodeBorderSize()); m_spinInternalNodeBorderSize->SetValue(geoTreeView->GetInternalNodeBorderSize()); m_spinGeoPointBorderSize->SetValue(geoTreeView->GetGeoPtsBorderSize()); m_spinLocationLineBorderSize->SetValue(geoTreeView->GetLocationLineBorderSize()); m_spinCorrelationLineBorderSize->SetValue(geoTreeView->GetCorrelationLineBorderSize()); Colour leafNodeBorderColour = geoTreeView->GetLeafNodeBorderColour(); m_colourLeafNodeBorder->SetColour(wxColour(leafNodeBorderColour.GetRedInt(), leafNodeBorderColour.GetGreenInt(), leafNodeBorderColour.GetBlueInt(), leafNodeBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourLeafNodeBorder, leafNodeBorderColour ); Colour internalNodeBorderColour = geoTreeView->GetInternalNodeBorderColour(); m_colourInternalNodeBorder->SetColour(wxColour(internalNodeBorderColour.GetRedInt(), internalNodeBorderColour.GetGreenInt(), internalNodeBorderColour.GetBlueInt(), internalNodeBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourInternalNodeBorder, internalNodeBorderColour ); Colour geoPtsBorderColour = geoTreeView->GetGeoPtsBorderColour(); m_colourGeoPointBorder->SetColour(wxColour(geoPtsBorderColour.GetRedInt(), geoPtsBorderColour.GetGreenInt(), geoPtsBorderColour.GetBlueInt(), geoPtsBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourGeoPointBorder, geoPtsBorderColour ); Colour branchBorderColour = geoTreeView->GetBranchBorderColour(); m_colourBranchBorder->SetColour(wxColour(branchBorderColour.GetRedInt(), branchBorderColour.GetGreenInt(), branchBorderColour.GetBlueInt(), branchBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourBranchBorder, branchBorderColour ); Colour locationLineBorderColour = geoTreeView->GetLocationLineBorderColour(); m_colourLocationLineBorder->SetColour(wxColour(locationLineBorderColour.GetRedInt(), locationLineBorderColour.GetGreenInt(), locationLineBorderColour.GetBlueInt(), locationLineBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourLocationLineBorder, locationLineBorderColour ); Colour correlationLineBorderColour = geoTreeView->GetCorrelationLineBorderColour(); m_colourCorrelationLineBorder->SetColour(wxColour(correlationLineBorderColour.GetRedInt(), correlationLineBorderColour.GetGreenInt(), correlationLineBorderColour.GetBlueInt(), correlationLineBorderColour.GetAlphaInt())); ReplaceColourPicker( m_colourCorrelationLineBorder, correlationLineBorderColour ); // location line properties m_spinLocationLineThickness->SetValue(geoTreeView->LocationLines().GetThickness()); if(geoTreeView->LocationLines().GetLineStyle() == VisualLine::SOLID) m_cboLocationLineStyle->SetValue(_T("Solid")); else if(geoTreeView->LocationLines().GetLineStyle() == VisualLine::SHORT_DASH) m_cboLocationLineStyle->SetValue(_T("Short dash")); else if(geoTreeView->LocationLines().GetLineStyle() == VisualLine::LONG_DASH) m_cboLocationLineStyle->SetValue(_T("Long dash")); else if(geoTreeView->LocationLines().GetLineStyle() == VisualLine::HIDDEN) m_cboLocationLineStyle->SetValue(_T("Hidden")); // correlation line properties m_spinCorrelationLineThickness->SetValue(geoTreeView->CorrelationLines().GetThickness()); if(geoTreeView->CorrelationLines().GetLineStyle() == VisualLine::SOLID) m_cboCorrelationLineStyle->SetValue(_T("Solid")); else if(geoTreeView->CorrelationLines().GetLineStyle() == VisualLine::SHORT_DASH) m_cboCorrelationLineStyle->SetValue(_T("Short dash")); else if(geoTreeView->CorrelationLines().GetLineStyle() == VisualLine::LONG_DASH) m_cboCorrelationLineStyle->SetValue(_T("Long dash")); else if(geoTreeView->CorrelationLines().GetLineStyle() == VisualLine::HIDDEN) m_cboCorrelationLineStyle->SetValue(_T("Hidden")); // internal drop line properties m_spinInternalDropLineThickness->SetValue(geoTreeView->Get3dInternalDropLineStyle().GetSize()); Colour colour = geoTreeView->Get3dInternalDropLineStyle().GetColour(); m_colourInternalDropLine->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt(), colour.GetAlphaInt())); ReplaceColourPicker( m_colourInternalDropLine, colour ); if(geoTreeView->Get3dInternalDropLineStyle().GetLineStyle() == VisualLine::SOLID) m_cboInternalDropLineStyle->SetValue(_T("Solid")); else if(geoTreeView->Get3dInternalDropLineStyle().GetLineStyle() == VisualLine::SHORT_DASH) m_cboInternalDropLineStyle->SetValue(_T("Short dash")); else if(geoTreeView->Get3dInternalDropLineStyle().GetLineStyle() == VisualLine::LONG_DASH) m_cboInternalDropLineStyle->SetValue(_T("Long dash")); else if(geoTreeView->Get3dInternalDropLineStyle().GetLineStyle() == VisualLine::HIDDEN) m_cboInternalDropLineStyle->SetValue(_T("Hidden")); // leaf drop line properties if(geoTreeView->Get3dLeafDropLineStyle().GetLineStyle() == VisualLine::SOLID) m_cboLeafDropLineStyle->SetValue(_T("Solid")); else if(geoTreeView->Get3dLeafDropLineStyle().GetLineStyle() == VisualLine::SHORT_DASH) m_cboLeafDropLineStyle->SetValue(_T("Short dash")); else if(geoTreeView->Get3dLeafDropLineStyle().GetLineStyle() == VisualLine::LONG_DASH) m_cboLeafDropLineStyle->SetValue(_T("Long dash")); else if(geoTreeView->Get3dLeafDropLineStyle().GetLineStyle() == VisualLine::HIDDEN) m_cboLeafDropLineStyle->SetValue(_T("Hidden")); // geography line properties m_spinGeoLineOffset->SetValue(uint(geoTreeView->GetGeographyLineOffsetPercentage()*100 + 0.5)); m_spinGeoLineThickness->SetValue(geoTreeView->GeographyLine().GetSize()); if(geoTreeView->GeographyLine().GetLineStyle() == VisualLine::SOLID) m_cboGeoLineStyle->SetValue(_T("Solid")); else if(geoTreeView->GeographyLine().GetLineStyle() == VisualLine::SHORT_DASH) m_cboGeoLineStyle->SetValue(_T("Short dash")); else if(geoTreeView->GeographyLine().GetLineStyle() == VisualLine::LONG_DASH) m_cboGeoLineStyle->SetValue(_T("Long dash")); else if(geoTreeView->GeographyLine().GetLineStyle() == VisualLine::HIDDEN) m_cboGeoLineStyle->SetValue(_T("Hidden")); colour = geoTreeView->GeographyLine().GetColour(); m_colourGeoLine->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt(), colour.GetAlphaInt())); ReplaceColourPicker( m_colourGeoLine, colour ); // geographic point properties m_spinGeoPointSize->SetValue(geoTreeView->GeographicPoints().GetSize()); m_chkDrawGeoPoint->SetValue(geoTreeView->GeographicPoints().GetVisibility()); m_chkEvenlySpeadGeoPts->SetValue(geoTreeView->GetSpreadGeographyPts()); m_chkDrawGeoAxis->SetValue(geoTreeView->GetGeographicAxisVisibility()); m_chkOptimizeLeafNodes->SetValue(geoTreeView->GetOptimizeTopology()); // *** Set state of controls on Label page m_spinLabelSize->SetValue(geoTreeView->GetFontSize()); Colour fontColour = geoTreeView->GetFontColour(); m_colourLabel->SetColour(wxColour(fontColour.GetRedInt(), fontColour.GetGreenInt(), fontColour.GetBlueInt(), fontColour.GetAlphaInt())); ReplaceColourPicker( m_colourLabel, fontColour ); m_chkShowLabels->SetValue(geoTreeView->GetLabelVisibility()); // set state of controls on Metadata page m_txtLayerSource->SetValue(wxString(m_treeLayer->GetPath().c_str()) + _T("\\") + wxString(m_treeLayer->GetFilename().c_str())); SetMetaData(); }
void PygmyFrame::SetDefaultValues() { // *** Tree Appearance m_spinLineWeight->SetValue(State::Inst().GetLineWidth()); m_chkOptimizeLeafOrder->SetValue(State::Inst().GetOptimizeLeafNodeOrdering()); // *** Leaf Labels std::wstring fontFile = State::Inst().GetFontFile(); fontFile = fontFile.substr(fontFile.find('/')+1, fontFile.find('.')-fontFile.find('/')-1); m_choiceLeafFont->SetStringSelection(fontFile); m_spinLeafFontSize->SetValue(State::Inst().GetTreeFontSize()); Colour colour = State::Inst().GetTreeFontColour(); m_colourLeafFont->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); m_chkAppendMetadata->SetValue(State::Inst().GetShowMetadataLabels()); m_chkShowLeafLabels->SetValue(State::Inst().GetShowLeafLabels()); // *** Overview Appearance m_spinOverviewLineWeight->SetValue(State::Inst().GetOverviewLineWidth()); m_chkColourOverviewTree->SetValue(State::Inst().GetColourOverviewTree()); m_chkShowPositionOverlay->SetValue(State::Inst().GetOverviewPositionOverlay()); // *** Colour Map Visualization m_spinColourMapWidth->SetValue(State::Inst().GetColourMapWidth()); m_chkShowColourMap->SetValue(State::Inst().GetShowColourMapVis()); m_chkShowColourMapTicks->SetValue(State::Inst().GetShowColourMapTickMarks()); colour = State::Inst().GetDefaultTreeColour(); ColourMap::SetDefaultColour(colour); m_defaultTreeColour->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); colour = State::Inst().GetColourMissingData(); m_colourMissingData->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); m_chkIgnoreLeafNodes->SetValue(State::Inst().GetIgnoreMissingData()); // *** Colour Map Labels colour = State::Inst().GetColourMapFontColour(); m_colourMapLabelColour->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); m_spinColourMapLabelSize->SetValue(State::Inst().GetColourMapFontSize()); m_spinColourMapLabelPrecision->SetValue(State::Inst().GetColourMapFontPrecision()); m_spinColourMapNumberOfLabels->SetValue(State::Inst().GetColourMapValuesToDisplay()); m_chkScientific->SetValue(State::Inst().GetColourMapFontScientific()); //*** Internal Node Labels colour = State::Inst().GetInternalNodeFontColour(); m_internalNodeLabelColour->SetColour(wxColour(colour.GetRedInt(), colour.GetGreenInt(), colour.GetBlueInt())); m_cboInternalNodeLabelsField->SetValue(State::Inst().GetInternalNodeField()); m_cboInternalLabelPos->SetValue(State::Inst().GetInternalLabelPos()); m_spinInternalNodeLabelSize->SetValue(State::Inst().GetInternalNodeFontSize()); m_spinInternalNodeLabelPrecision->SetValue(State::Inst().GetInternalNodeFontPrecision()); m_chkInternalNodeLabelScientificNotation->SetValue(State::Inst().GetInternalNodeFontScientific()); m_chkShowInternalLabels->SetValue(State::Inst().GetShowInternalLabels()); // *** Mouse Settings m_sliderScrollSensitivity->SetValue(State::Inst().GetScrollSensitivity()); m_sliderTranslationSensitibity->SetValue(State::Inst().GetTranslationSensitivity()*10); m_sliderZoomSensitivity->SetValue(State::Inst().GetZoomSensitivity()*1000); }