void SetPicture() { if(rbXy && rbXy->GetValue())SetPicture(&m_xy_bitmap, _T("xy")); else if(rbXz && rbXz->GetValue())SetPicture(&m_xz_bitmap, _T("xz")); else if(rbYz && rbYz->GetValue())SetPicture(&m_yz_bitmap, _T("yz")); else if(rbOther && rbOther->GetValue())SetPicture(&m_line_bitmap, _T("line")); }
void DrillingDlg::SetPictureByWindow(wxWindow* w) { if(w == m_dblDwell)SetPicture(_T("dwell")); else if(w == m_chkFeedRetract) { if(m_chkFeedRetract->GetValue())SetPicture(_T("feed retract")); else SetPicture(_T("rapid retract")); } else if(w == m_chkStopSpindleAtBottom) { if(m_chkStopSpindleAtBottom->GetValue())SetPicture(_T("stop spindle at bottom")); else SetPicture(_T("dont stop spindle")); } else if(w == m_chkInternalCoolantOn) { if(m_chkInternalCoolantOn->GetValue())SetPicture(_T("internal coolant on")); else SetPicture(_T("internal coolant off")); } else if(w == m_chkRapidToClearance) { if(m_chkRapidToClearance->GetValue())SetPicture(_T("rapid to clearance")); else SetPicture(_T("rapid to standoff")); } else DepthOpDlg::SetPictureByWindow(w); }
void OnRadioButton(wxCommandEvent& event) { if(m_ignore_event_functions)return; switch(event.GetId()) { case ID_RADIO1: case ID_RADIO2: case ID_RADIO3: if(m_axis_type == 0) { EndModal(event.GetId()); return; } break; case ID_RADIO_OTHER: if(m_axis_type != 0) { EndModal(event.GetId()); return; } break; } SetPicture(); }
void CRunView::OnInitialUpdate() { CFormView::OnInitialUpdate(); CString strPicture = GetDocument()->GetPathName(); SetPicture(strPicture); }
void OpDlg::SetPictureByWindow(wxWindow* w) { if(w == m_cmbPattern) { int pattern_id = m_cmbPattern->GetSelectedId(); if(pattern_id != 0) { PatternDlg::RedrawBitmap(m_picture->m_bitmap, (CPattern*)(heeksCAD->GetIDObject(PatternType, pattern_id))); m_picture->m_bitmap_set = true; m_picture->Refresh(); } else SetPicture(_T("general")); } else if(w == m_cmbSurface)HeeksObjDlg::SetPicture(theApp.GetDialogBitmapPath(_T("general"), _T("surface"))); else SetPicture(_T("general")); }
void CToolDlg::OnChildFocus(wxChildFocusEvent& event) { if(m_ignore_event_functions)return; if(event.GetWindow()) { SetPicture(); } }
void BNavigatorButton::AttachedToWindow() { BBitmap *bmpOn = 0; GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, fResIDOn, &bmpOn); SetPicture(bmpOn, true, true); delete bmpOn; BBitmap *bmpOff = 0; GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, fResIDOff, &bmpOff); SetPicture(bmpOff, true, false); delete bmpOff; BBitmap *bmpDisabled = 0; GetTrackerResources()->GetBitmapResource(B_MESSAGE_TYPE, fResIDDisabled, &bmpDisabled); SetPicture(bmpDisabled, false, false); SetPicture(bmpDisabled, false, true); delete bmpDisabled; }
void SectionViewWidget::OnRedo() { if(m_StackPos<m_PicStack.size()-1) { m_StackPos++; SetPicture(); } SailDlg *pSailDlg = (SailDlg*)m_pSailDlg; pSailDlg->SetControls(); }
void SectionViewWidget::OnUndo() { if(m_StackPos>0) { m_StackPos--; SetPicture(); } SailDlg *pSailDlg = (SailDlg*)m_pSailDlg; pSailDlg->SetControls(); }
/**\brief Initializes a new Engine with the given parameters. * \param _name Name of the Engine * \param _thrustsound Pointer to a Sound object that will be played for thrust * \param _forceOutput The amount of force the Engine generates * \param _msrp Price of the Engine * \param foldDrive Fold capable * \param _flareAnimation Thrust animation */ Engine::Engine( string _name, Sound* _thrustsound, float _forceOutput, short int _msrp, bool _foldDrive, string _flareAnimation, Image* _pic) : thrustsound(_thrustsound), foldDrive(_foldDrive), flareAnimation(_flareAnimation) { SetName(_name); SetMSRP(_msrp); SetPicture(_pic); SetForceOutput(_forceOutput); }
void PictureWindow::SetPicture(const wxString& filepath, long image_type) { std::map<wxString, wxBitmap*>::iterator FindIt = m_bitmaps.find(filepath); wxBitmap* bitmap = NULL; if(FindIt == m_bitmaps.end()) { bitmap = new wxBitmap(wxImage(filepath, image_type)); } else { bitmap = FindIt->second; } SetPicture(*bitmap); }
/**\brief For parsing XML file into fields. */ bool Model::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"image")) ){ image = Image::Get( NodeToString(doc,attr) ); Image::Store(name, image); SetPicture(image); } else return false; if( (attr = FirstChildNamed(node,"mass")) ){ value = NodeToString(doc,attr); SetMass( static_cast<float> (atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"rotationsPerSecond")) ){ value = NodeToString(doc,attr); SetRotationsPerSecond( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"thrustOffset")) ){ value = NodeToString(doc,attr); thrustOffset = static_cast<short>(atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"maxSpeed")) ){ value = NodeToString(doc,attr); SetMaxSpeed( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"msrp")) ){ value = NodeToString(doc,attr); SetMSRP( (short int)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"cargoSpace")) ){ value = NodeToString(doc,attr); SetCargoSpace( atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"hullStrength")) ){ value = NodeToString(doc,attr); SetHullStrength( (short)atoi( value.c_str() )); } else return false; return true; }
/**\brief Parser to parse the XML file */ bool Engine::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"forceOutput")) ){ value = NodeToString(doc,attr); SetForceOutput( static_cast<float> (atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"msrp")) ){ value = NodeToString(doc,attr); SetMSRP( (short int)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"foldDrive")) ){ value = NodeToString(doc,attr); foldDrive = (atoi( value.c_str() ) != 0); } else return false; if( (attr = FirstChildNamed(node,"flareAnimation")) ){ flareAnimation = NodeToString(doc,attr); } else return false; if( (attr = FirstChildNamed(node,"thrustSound")) ){ thrustsound = Sound::Get( NodeToString(doc,attr) ); } else return false; if( (attr = FirstChildNamed(node,"picName")) ){ Image* pic = Image::Get( NodeToString(doc,attr) ); // This image can be accessed by either the path or the Engine Name Image::Store(name, pic); SetPicture(pic); } else return false; return true; }
/**\brief Creates a new Weapon object given parameters. * \param _name Name of the weapon * \param _image Picture of the weapon as fired * \param _pic Picture of the weapon in shop * \param _weaponType Type of weapon * \param _payload Amount of damage * \param _velocity Traveling velocity * \param _acceleration Acceleration of the weapon * \param _ammoType Type of ammo required * \param _ammoConsumption Amount of ammo consumed per shot * \param _fireDelay Delay after firing * \param _lifetime Life the ammo * \param _sound Sound the weapon makes * \param _tracking Turning rate * \param _msrp Price of the weapon */ Weapon::Weapon( string _name, Image* _image, Image* _pic, string _description, int _weaponType, int _payload, int _velocity, int _acceleration, AmmoType _ammoType, int _ammoConsumption, int _fireDelay, int _lifetime, Sound* _sound, float _tracking, int _msrp): image(_image), sound(_sound), weaponType(_weaponType), payload(_payload), velocity(_velocity), acceleration(_acceleration), ammoType(_ammoType), ammoConsumption(_ammoConsumption), fireDelay(_fireDelay), lifetime(_lifetime), tracking(_tracking) { SetName(_name); SetMSRP( _msrp ); SetPicture( _pic ); SetDescription( _description ); // Generic Outfit stuff //((Component*)this)->SetName(_name); }
void CToolDlg::SetPicture() { wxWindow* w = FindFocus(); if(w == m_dblDiameter)SetPicture(&m_diameter_bitmap, _T("diameter")); else if(w == m_dblToolLengthOffset)SetPicture(&m_tool_length_offset_bitmap, _T("toollengthoffset")); else if(w == m_dblFlatRadius)SetPicture(&m_flat_radius_bitmap, _T("flatradius")); else if(w == m_dblCornerRadius)SetPicture(&m_corner_radius_bitmap, _T("cornerradius")); else if(w == m_dblCuttingEdgeAngle)SetPicture(&m_cutting_edge_angle_bitmap, _T("cuttingedgeangle")); else if(w == m_dblCuttingEdgeHeight)SetPicture(&m_cutting_edge_height_bitmap, _T("cuttingedgeheight")); // The following are all for lathe tools. They become relevant when the m_type = eTurningTool else if(w == m_dblXOffset)SetPicture(&m_x_offset_bitmap, _T("xoffset")); else if(w == m_dblFrontAngle)SetPicture(&m_front_angle_bitmap, _T("frontangle")); else if(w == m_dblToolAngle)SetPicture(&m_tool_angle_bitmap, _T("toolangle")); else if(w == m_dblBackAngle)SetPicture(&m_back_angle_bitmap, _T("backangle")); else if(w == m_lgthorientation)SetPicture(&m_orientation_bitmap, _T("orientation")); // The following are for probe tools else if(w == m_dblProbeOffsetX)SetPicture(&m_probe_offset_x_bitmap, _T("probeoffsetx")); else if(w == m_dblProbeOffsetY)SetPicture(&m_probe_offset_y_bitmap, _T("probeoffsety")); // The following are for extrusion else if(w == m_dblLayerHeight)SetPicture(&m_layer_height_bitmap, _T("layerheight")); else if(w == m_dblWidthOverThickness)SetPicture(&m_width_over_thickness_bitmap, _T("wovert")); else if(w == m_dblTemperature)SetPicture(&m_temperature_bitmap, _T("temperature")); else if(w == m_dblFilamentDiameter)SetPicture(&m_filament_diameter_bitmap, _T("filament")); // The following are for tap tools // else if(w == m_dblPitch)SetPicture(&m_probe_offset_x_bitmap, _T("probeoffsetx")); // else if(w == m_dblProbeOffsetY)SetPicture(&m_probe_offset_y_bitmap, _T("probeoffsety")); else SetPicture(&m_general_bitmap, _T("general")); }
/**\brief Parses weapon information */ bool Weapon::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"weaponType")) ){ weaponType = (short int)NodeToInt(doc,attr); } else { LogMsg(ERR,"Could not find child node weaponType while searching component"); return false; } if( (attr = FirstChildNamed(node,"imageName")) ){ image = Image::Get( NodeToString(doc,attr) ); } else { LogMsg(ERR,"Could not find child node imageName while searching component"); return false; } if( (attr = FirstChildNamed(node,"picName")) ){ Image* pic = Image::Get( NodeToString(doc,attr) ); // This image can be accessed by either the path or the Weapon Name Image::Store(name, pic); SetPicture(pic); } else { LogMsg(ERR,"Could not find child node picName while searching component"); return false; } if( (attr = FirstChildNamed(node,"description")) ){ value = NodeToString(doc,attr); SetDescription( value ); } else { LogMsg( WARN, "%s does not have a description.", GetName().c_str() ); } if( (attr = FirstChildNamed(node,"payload")) ){ payload = NodeToInt(doc,attr); } else { LogMsg(ERR,"Could not find child node payload while searching component"); return false; } if( (attr = FirstChildNamed(node,"velocity")) ){ velocity = NodeToInt(doc,attr); } else { LogMsg(ERR,"Could not find child node velocity while searching component"); return false; } if( (attr = FirstChildNamed(node,"acceleration")) ){ acceleration = NodeToInt(doc,attr); } else { LogMsg(ERR,"Could not find child node acceleration while searching component"); return false; } if( (attr = FirstChildNamed(node,"ammoType")) ){ value = NodeToString(doc,attr); ammoType = AmmoNameToType(value); if(ammoType>=max_ammo) { LogMsg(ERR,"ammoType is >= max_ammo in Weapons XML parsing"); return false; } } else { LogMsg(ERR,"Could not find child node ammoType while searching component"); return false; } if( (attr = FirstChildNamed(node,"ammoConsumption")) ){ ammoConsumption = NodeToInt(doc,attr); } else { LogMsg(ERR,"Could not find child node ammoConsumption while searching component"); return false; } if( (attr = FirstChildNamed(node, "fireDelay")) ) { fireDelay = NodeToInt(doc,attr); } else { LogMsg(ERR, "Could not find child node fireDelay while searching component"); return false; } if( (attr = FirstChildNamed(node, "lifetime")) ) { lifetime = NodeToInt(doc,attr); } else { LogMsg(ERR, "Could not find child node lifetime while searching component"); return false; } if( (attr = FirstChildNamed(node,"tracking")) ) { float _tracking = NodeToFloat(doc,attr); if (_tracking > 1.0f ) _tracking = 1.0f; if (_tracking < 0.0001f ) _tracking = 0.0f; tracking = _tracking; } else { LogMsg(ERR, "Could not find child node tracking while searching component"); return false; } if( (attr = FirstChildNamed(node, "msrp")) ) { value = NodeToString(doc,attr); SetMSRP( (short int)atoi( value.c_str() )); } else { LogMsg(ERR, "Could not find child node msrp while searching component"); return false; } if( (attr = FirstChildNamed(node, "sound")) ) { value = NodeToString(doc,attr); this->sound = Sound::Get( value ); if( this->sound == NULL) { // Do not return false here - they may be disabling audio on purpose or audio may not be supported on their system LogMsg(WARN, "Could not load sound file while searching component"); } } else { LogMsg(ERR, "Could not find child node sound while searching component"); return false; } return true; }
void HeeksObjDlg::SetPictureByWindow(wxWindow* w) { SetPicture(_T("general")); }
CellWallDestructable::CellWallDestructable(void) { SetActivity(true); SetPicture(cell_pic[4]); }
void HeeksObjDlg::SetPicture(const wxString& name) { SetPicture(name, _T("heeksobj")); }
/**\brief For parsing XML file into fields. */ bool Model::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"image")) ){ image = Image::Get( NodeToString(doc,attr) ); Image::Store(name, image); SetPicture(image); } else return false; if( (attr = FirstChildNamed(node,"description")) ){ value = NodeToString(doc,attr); SetDescription( value ); } else { LogMsg( WARN, "%s does not have a description.", GetName().c_str() ); } if( (attr = FirstChildNamed(node,"engine")) ){ defaultEngine = Menu::GetCurrentScenario()->GetEngines()->GetEngine( NodeToString(doc,attr) ); } else return false; if( (attr = FirstChildNamed(node,"mass")) ){ value = NodeToString(doc,attr); SetMass( static_cast<float> (atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"rotationsPerSecond")) ){ value = NodeToString(doc,attr); SetRotationsPerSecond( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"thrustOffset")) ){ value = NodeToString(doc,attr); thrustOffset = static_cast<short>(atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"maxSpeed")) ){ value = NodeToString(doc,attr); SetMaxSpeed( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"msrp")) ){ value = NodeToString(doc,attr); SetMSRP( (short int)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"cargoSpace")) ){ value = NodeToString(doc,attr); SetCargoSpace( atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"hullStrength")) ){ value = NodeToString(doc,attr); SetHullStrength( (short)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"shieldStrength")) ){ value = NodeToString(doc,attr); SetShieldStrength( (short)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"weaponSlots")) ){ // pass the weaponSlots XML node into a handler function ConfigureWeaponSlots( doc, attr ); } else { //LogMsg( WARN, "Did not find weapon slot configuration - ship cannot have weapons."); } return true; }
void PocketDlg::SetPictureByWindow(wxWindow* w) { if(w == m_lgthStepOver)SetPicture(_T("step over")); else if(w == m_lgthMaterialAllowance)SetPicture(_T("material allowance")); else if(w == m_cmbStartingPlace) { if(m_cmbStartingPlace->GetValue() == _("Boundary"))SetPicture(_T("starting boundary")); else SetPicture(_T("starting center")); } else if(w == m_cmbCutMode) { if(m_cmbCutMode->GetValue() == _("Climb"))SetPicture(_T("climb milling")); else SetPicture(_T("conventional milling")); } else if(w == m_chkKeepToolDown) { if(m_chkKeepToolDown->GetValue())SetPicture(_T("tool down")); else SetPicture(_T("not tool down")); } else if(w == m_chkUseZigZag || w == m_chkZigUnidirectional) { if(m_chkUseZigZag->GetValue()) { if(m_chkZigUnidirectional->GetValue())SetPicture(_T("zig unidirectional")); else SetPicture(_T("use zig zag")); } else SetPicture(_T("general")); } else if(w == m_dblZigAngle)SetPicture(_T("zig angle")); else SketchOpDlg::SetPictureByWindow(w); }
void CPictureButton::SetPicture(std::string sPictureFile) { SetPicture(CBitmapFileResourceHandle(sPictureFile)); }
CToolDlg::CToolDlg(wxWindow *parent, CTool* object) : HDialog(parent, wxID_ANY, wxString(_T("Tool Definition"))) { m_ignore_event_functions = true; wxBoxSizer *sizerMain = new wxBoxSizer(wxHORIZONTAL); // add left sizer wxBoxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); sizerMain->Add( sizerLeft, 0, wxALL, control_border ); // add right sizer wxBoxSizer *sizerRight = new wxBoxSizer(wxVERTICAL); sizerMain->Add( sizerRight, 0, wxALL, control_border ); // add picture to right side m_picture = new PictureWindow(this, wxSize(300, 200)); wxBoxSizer *pictureSizer = new wxBoxSizer(wxVERTICAL); pictureSizer->Add(m_picture, 1, wxGROW); sizerRight->Add( pictureSizer, 0, wxALL, control_border ); // add some of the controls to the right side // The following are for extrusion and should be hidden for all others wxString extrusionmaterials[] = {_("ABS Plastic"),_("PLA Plastic"),_("HDPE Plastic"),_("Other") }; AddLabelAndControl(sizerRight, _("Extrusion Material"),m_cmbExtrusionMaterial = new wxComboBox(this, ID_EXTRUSIONMATERIAL, _T(""), wxDefaultPosition, wxDefaultSize, 4, extrusionmaterials)); AddLabelAndControl(sizerRight, _("Feed Rate"),m_dblFeedRate = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Layer Height"),m_dblLayerHeight = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Width Over Thickness ratio"),m_dblWidthOverThickness = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Temperature"),m_dblTemperature = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Flow Rate"),m_dblFlowrate = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Filament Diameter"),m_dblFilamentDiameter = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerRight, _("Title"), m_txtTitle = new wxTextCtrl(this, ID_TITLE)); sizerRight->Add( m_chkVisible = new wxCheckBox( this, ID_VISIBLE, _("Visible") ), 0, wxALL, control_border ); // The following are for taps and should be hidden for all others AddLabelAndControl(sizerRight, _("Pitch"),m_dblPitch = new CDoubleCtrl(this, ID_PITCH)); wxString tapdirections[] = {_("right hand"),_("left hand") }; AddLabelAndControl(sizerRight, _("Tap direction"),m_cmbDirection = new wxComboBox(this, ID_DIRECTION, _T(""), wxDefaultPosition, wxDefaultSize, 2, tapdirections)); // add OK and Cancel to right side wxBoxSizer *sizerOKCancel = MakeOkAndCancel(wxHORIZONTAL); sizerRight->Add( sizerOKCancel, 0, wxALL | wxALIGN_RIGHT | wxALIGN_BOTTOM, control_border ); // add all the controls to the left side wxString title_choices[] = {_("Leave manually assigned title"), _("Automatically Generate Title")}; AddLabelAndControl(sizerLeft, _("Title Type"), m_cmbTitleType = new wxComboBox(this, ID_TITLE_TYPE, _T(""), wxDefaultPosition, wxDefaultSize, 2, title_choices)); wxString materials[] = {_("High Speed Steel"),_("Carbide") }; AddLabelAndControl(sizerLeft, _("Tool Material"), m_cmbMaterial = new wxComboBox(this, ID_MATERIAL, _T(""), wxDefaultPosition, wxDefaultSize, 2, materials)); wxString tool_types[] = {_("Drill Bit"), _("Centre Drill Bit"), _("End Mill"), _("Slot Cutter"), _("Ball End Mill"), _("Chamfer"), _("Turning Tool"), _("Touch Probe"), _("Tool Length Switch"), _("Extrusion"),_("Tap Tool")}; AddLabelAndControl(sizerLeft, _("Tool Type"), m_cmbToolType = new wxComboBox(this, ID_TOOL_TYPE, _T(""), wxDefaultPosition, wxDefaultSize, 11, tool_types)); AddLabelAndControl(sizerLeft, _("Max advance per revolution"), m_dblMaxAdvancePerRevolution = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Diameter"), m_dblDiameter = new CDoubleCtrl(this, ID_DIAMETER)); AddLabelAndControl(sizerLeft, _("Tool length offset"), m_dblToolLengthOffset = new CDoubleCtrl(this, ID_TOOL_LENGTH_OFFSET)); AddLabelAndControl(sizerLeft, _("Flat radius"), m_dblFlatRadius = new CDoubleCtrl(this, ID_FLAT_RADIUS)); AddLabelAndControl(sizerLeft, _("Corner radius"), m_dblCornerRadius = new CDoubleCtrl(this, ID_CORNER_RADIUS)); AddLabelAndControl(sizerLeft, _("Cutting edge angle"), m_dblCuttingEdgeAngle = new CDoubleCtrl(this, ID_CUTTING_EDGE_ANGLE)); AddLabelAndControl(sizerLeft, _("Cutting edge height"), m_dblCuttingEdgeHeight = new CDoubleCtrl(this, ID_CUTTING_EDGE_HEIGHT)); AddLabelAndControl(sizerLeft, _("gradient"), m_dblGradient = new CDoubleCtrl(this, ID_GRADIENT)); // The following are all for lathe tools and should be hidden for all others AddLabelAndControl(sizerLeft, _("X Offset"),m_dblXOffset = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Front Angle"),m_dblFrontAngle = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Tool Angle"),m_dblToolAngle = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Back Angle"),m_dblBackAngle = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Orientation"),m_lgthorientation = new CLengthCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); // The following are for probe tools and should be hidden for all others AddLabelAndControl(sizerLeft, _("Probe Offset X"),m_dblProbeOffsetX = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); AddLabelAndControl(sizerLeft, _("Probe Offset Y"),m_dblProbeOffsetY = new CDoubleCtrl(this, ID_MAX_ADVANCE_PER_REVOLUTION)); SetFromData(object); SetSizer( sizerMain ); sizerMain->SetSizeHints(this); sizerMain->Fit(this); m_cmbTitleType->SetFocus(); m_ignore_event_functions = false; SetPicture(); }
/**\brief For parsing XML file into fields. */ bool Model::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"image")) ){ image = Image::Get( NodeToString(doc,attr) ); Image::Store(name, image); SetPicture(image); } else return false; if( (attr = FirstChildNamed(node,"mass")) ){ value = NodeToString(doc,attr); SetMass( static_cast<float> (atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"rotationsPerSecond")) ){ value = NodeToString(doc,attr); SetRotationsPerSecond( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"thrustOffset")) ){ value = NodeToString(doc,attr); thrustOffset = static_cast<short>(atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"maxSpeed")) ){ value = NodeToString(doc,attr); SetMaxSpeed( static_cast<float>(atof( value.c_str() ))); } else return false; if( (attr = FirstChildNamed(node,"msrp")) ){ value = NodeToString(doc,attr); SetMSRP( (short int)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"cargoSpace")) ){ value = NodeToString(doc,attr); SetCargoSpace( atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"hullStrength")) ){ value = NodeToString(doc,attr); SetHullStrength( (short)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"shieldStrength")) ){ value = NodeToString(doc,attr); SetShieldStrength( (short)atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"weaponSlots")) ){ // pass the weaponSlots XML node into a handler function ConfigureWeaponSlots( doc, attr ); } else { cout << "Model::FromXMLNode(): Did not find weapon slot configuration - assuming defaults." << endl; // with no parameters, it sets default values ConfigureWeaponSlots(); } return true; }
void PictureWindow::SetPicture(wxBitmap** b, const wxString& filepath, long image_type) { if(*b == NULL)*b = new wxBitmap(wxImage(filepath, image_type)); SetPicture(**b); }
void PocketDlg::SetPictureByWindow(wxWindow* w) { if(w == m_lgthStepOver) { SetPicture(_T("step over")); } else if(w == m_lgthMaterialAllowance) { SetPicture(_T("material allowance")); } else if(w == m_cmbStartingPlace) { if(m_cmbStartingPlace->GetValue() == _("Boundary"))SetPicture(_T("starting boundary")); else SetPicture(_T("starting center")); } else if(w == m_cmbCutMode) { if(m_cmbCutMode->GetValue() == _("Climb"))SetPicture(_T("climb milling")); else SetPicture(_T("conventional milling")); } else if(w == m_cmbPostProcessor) { wxString value = m_cmbPostProcessor->GetValue(); if ( value.Cmp(_("ZigZag")) == 0 ) { SetPicture(_T("use zig zag")); } else if ( value.Cmp(_("ZigZag Unidirectional")) == 0 ) { SetPicture(_T("zig unidirectional")); } else if ( value.Cmp(_("Offsets")) == 0 ) { SetPicture(_T("general")); } else if ( value.Cmp(_("Trochoidal")) == 0 ) { SetPicture(_T("general")); } } else if(w == m_dblZigAngle) { SetPicture(_T("zig angle")); } else SketchOpDlg::SetPictureByWindow(w); }
/**\brief Parses weapon information */ bool Outfit::FromXMLNode( xmlDocPtr doc, xmlNodePtr node ) { xmlNodePtr attr; string value; if( (attr = FirstChildNamed(node,"msrp")) ){ value = NodeToString(doc,attr); SetMSRP( atoi( value.c_str() )); } else return false; if( (attr = FirstChildNamed(node,"picName")) ){ Image* pic = Image::Get( NodeToString(doc,attr) ); // This image can be accessed by either the path or the Engine Name Image::Store(name, pic); SetPicture(pic); } else return false; if( (attr = FirstChildNamed(node,"rotationsPerSecond")) ){ value = NodeToString(doc,attr); SetRotationsPerSecond( static_cast<float>(atof( value.c_str() ))); } if( (attr = FirstChildNamed(node,"maxSpeed")) ){ value = NodeToString(doc,attr); SetMaxSpeed( static_cast<float>(atof( value.c_str() ))); } if( (attr = FirstChildNamed(node,"forceOutput")) ){ value = NodeToString(doc,attr); SetForceOutput( static_cast<float> (atof( value.c_str() ))); } if( (attr = FirstChildNamed(node,"mass")) ){ value = NodeToString(doc,attr); SetMass( static_cast<float> (atof( value.c_str() ))); } if( (attr = FirstChildNamed(node,"cargoSpace")) ){ value = NodeToString(doc,attr); SetCargoSpace( atoi( value.c_str() )); } if( (attr = FirstChildNamed(node,"surfaceArea")) ){ value = NodeToString(doc,attr); SetSurfaceArea( atoi( value.c_str() )); } if( (attr = FirstChildNamed(node,"cargoSpace")) ){ value = NodeToString(doc,attr); SetCargoSpace( atoi( value.c_str() )); } if( (attr = FirstChildNamed(node,"hullStrength")) ){ value = NodeToString(doc,attr); SetHullStrength( atoi( value.c_str() )); } if( (attr = FirstChildNamed(node,"shildStrength")) ){ value = NodeToString(doc,attr); SetShieldStrength( (short)atoi( value.c_str() )); } return true; }
func Initialize() { SetPicture(10,0,120,90); return(1); }
AngleAndPlaneDlg(wxWindow *parent, double angle, const double* axis, int axis_type, const double* pos, int *number_of_copies):HDialog(parent) { m_ignore_event_functions = true; m_axis_type = axis_type; wxBoxSizer *sizerMain = new wxBoxSizer(wxVERTICAL); if(number_of_copies) { AddLabelAndControl(sizerMain, _("number of copies"), txt_num_copies = new wxTextCtrl(this, wxID_ANY, wxString::Format(_T("%d"), *number_of_copies))); } wxBoxSizer *sizerPosAndAxis = new wxBoxSizer(wxHORIZONTAL); sizerMain->Add(sizerPosAndAxis, 0, wxGROW); if(pos) { wxBoxSizer *sizerPos = new wxBoxSizer(wxVERTICAL); sizerPosAndAxis->Add(sizerPos, 0, wxGROW); if(m_axis_type == 0)sizerPos->Add( new wxStaticText(this, wxID_ANY, _("Position to rotate about")), 0, wxEXPAND | wxALL, control_border ); else AddLabelAndControl(sizerPos, _("Position to rotate about"), new wxButton(this, ID_BUTTON_PICK, _("Select"))); AddLabelAndControl(sizerPos, _("X"), posx = new CLengthCtrl(this, ID_POSX)); AddLabelAndControl(sizerPos, _("Y"), posy = new CLengthCtrl(this, ID_POSY)); AddLabelAndControl(sizerPos, _("Z"), posz = new CLengthCtrl(this, ID_POSZ)); if(m_axis_type == 0)sizerPos->Add( new wxButton(this, ID_BUTTON_PICK, _("Select")), 0, wxEXPAND | wxALL, control_border ); posx->SetValue( pos[0] ); posy->SetValue( pos[1] ); posz->SetValue( pos[2] ); } if(axis) { // add picture m_picture = new PictureWindow(this, wxSize(150, 100)); wxBoxSizer *pictureSizer = new wxBoxSizer(wxHORIZONTAL); pictureSizer->Add(m_picture, 1, wxGROW); sizerMain->Add( pictureSizer, 0, wxALL, control_border ); wxBoxSizer *sizerPlane = new wxBoxSizer(wxVERTICAL); pictureSizer->Add(sizerPlane, 0, wxGROW); if(axis_type == 0) { // not standard axis wxBoxSizer *sizerAxis = new wxBoxSizer(wxVERTICAL); sizerPosAndAxis->Add(sizerAxis, 0, wxGROW); sizerAxis->Add( new wxStaticText(this, wxID_ANY, _("Axis to rotate about")), 0, wxEXPAND | wxALL, control_border ); AddLabelAndControl(sizerAxis, _("X"), vectorx = new CDoubleCtrl(this, ID_VECTORX)); AddLabelAndControl(sizerAxis, _("Y"), vectory = new CDoubleCtrl(this, ID_VECTORY)); AddLabelAndControl(sizerAxis, _("Z"), vectorz = new CDoubleCtrl(this, ID_VECTORZ)); sizerAxis->Add( new wxButton(this, ID_BUTTON_VECTOR_PICK, _("Select a line")), 0, wxEXPAND | wxALL, control_border ); vectorx->SetValue( axis[0] ); vectory->SetValue( axis[1] ); vectorz->SetValue( axis[2] ); } rbXy = new wxRadioButton( this, ID_RADIO1, _T("XY"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); rbXz = new wxRadioButton( this, ID_RADIO2, _T("XZ") ); rbYz = new wxRadioButton( this, ID_RADIO3, _T("YZ") ); rbOther = new wxRadioButton( this, ID_RADIO_OTHER, _T("Other") ); sizerPlane->Add( rbXy, 0, wxALL, control_border ); sizerPlane->Add( rbXz, 0, wxALL, control_border ); sizerPlane->Add( rbYz, 0, wxALL, control_border ); sizerPlane->Add( rbOther, 0, wxALL, control_border ); rbXy->SetValue( axis_type == 1 ); rbXz->SetValue( axis_type == 2 ); rbYz->SetValue( axis_type == 3 ); rbOther->SetValue( axis_type == 0 ); } else { rbXy = NULL; rbXz = NULL; rbYz = NULL; rbOther = NULL; } AddLabelAndControl(sizerMain, _("angle"), angle_ctrl = new CDoubleCtrl(this)); angle_ctrl->SetValue(angle); // add OK and Cancel to right side wxBoxSizer *sizerOKCancel = MakeOkAndCancel(wxHORIZONTAL); sizerMain->Add( sizerOKCancel, 0, wxALL | wxALIGN_RIGHT | wxALIGN_BOTTOM, control_border ); SetSizer( sizerMain ); sizerMain->SetSizeHints(this); sizerMain->Fit(this); if(number_of_copies)txt_num_copies->SetFocus(); else angle_ctrl->SetFocus(); SetPicture(); m_ignore_event_functions = false; }
void HeeksObjDlg::OnComboOrCheck( wxCommandEvent& event ) { if(m_ignore_event_functions)return; SetPicture(); }