Пример #1
0
void LayerDlg::OnLayerLoad( wxCommandEvent &event )
{
	VTLOG1("LayerDlg::OnLayerLoad\n");

	wxString filter = _("Layer Formats|");
	AddType(filter, FSTRING_SHP);
	if (g_App.m_state == AS_Terrain)
	{
		AddType(filter, FSTRING_VTST);
		AddType(filter, FSTRING_VF);
		AddType(filter, FSTRING_TIN);
	}

	wxFileDialog loadFile(NULL, _("Load Layer"), _T(""), _T(""), filter, wxFD_OPEN);
	bool bResult = (loadFile.ShowModal() == wxID_OK);
	if (!bResult)
		return;
	wxString str = loadFile.GetPath();
	vtString fname = (const char *) str.mb_str(wxConvUTF8);

	VTLOG1(" File dialog: ");
	VTLOG1(fname);
	VTLOG1("\n");

	GetFrame()->LoadLayer(fname);
}
Пример #2
0
int dlgCast::Go(bool modal)
{

	if (!connection->BackendMinimumVersion(7, 5))
		txtComment->Disable();

	if (cast)
	{
		// edit mode
		cbSourceType->Append(cast->GetSourceType());
		cbSourceType->SetSelection(0);
		cbSourceType->Disable();

		cbTargetType->Append(wxEmptyString);
		cbTargetType->Append(cast->GetTargetType());
		cbTargetType->SetSelection(1);
		cbTargetType->Disable();

		AddType(wxT(" "), cast->GetSourceTypeOid());
		AddType(wxT(" "), cast->GetTargetTypeOid());

		cbFunction->Append(cast->GetCastFunction());
		cbFunction->SetSelection(0);

		cbFunction->Disable();
		chkImplicit->Disable();
	}
	else
	{
		// create mode
		FillDatatype(cbSourceType, cbTargetType, false);
	}

	return dlgProperty::Go(modal);
}
void
JXDockDragData::AddTypes
	(
	const Atom selectionName
	)
{
	AddType((JXGetDockManager())->GetDNDMinSizeAtom());
	AddType((JXGetDockManager())->GetDNDWindowAtom());
}
Пример #4
0
void InitTypes(void)
{
    int i;

    for (i = 0; i < BASE_TYPES; i++)
        AddType(NewBaseType(base_types[i]));

    /* New types for the thops interpreter */
    for (i = 0; i < EXTENDED_TYPES; i++)
        AddType(NewBaseType(extended_types[i]));
}
Пример #5
0
void
JXImageSelection::AddTypes
	(
	const Atom selectionName
	)
{
	itsXPMXAtom = AddType(kXPMXAtomName);

	#ifdef _J_HAS_GD
	itsGIFXAtom = AddType(kGIFXAtomName);
	itsPNGXAtom = AddType(kPNGXAtomName);
	itsJPEGXAtom = AddType(kJPEGXAtomName);
	#endif
}
Пример #6
0
  bool AbstractRoutingProfile::ParametrizeForCar(const osmscout::TypeConfig& typeConfig,
                                                 const std::map<std::string,double>& speedMap,
                                                 double maxSpeed)
  {
    bool everythingResolved=true;

    speeds.clear();

    SetVehicle(vehicleCar);
    SetVehicleMaxSpeed(maxSpeed);

    for (const auto &type : typeConfig.GetTypes()) {
      if (!type->GetIgnore() &&
          type->CanRouteCar()) {
        std::map<std::string,double>::const_iterator speed=speedMap.find(type->GetName());

        if (speed==speedMap.end()) {
          log.Error() << "No speed for type '" << type->GetName() << "' defined!";
          everythingResolved=false;

          continue;
        }

        AddType(type,speed->second);
      }
    }

    return everythingResolved;
  }
Пример #7
0
XnStatus TypeManager::AddNewType(const XnChar* strName, XnProductionNodeType type, XnProductionNodeType base)
{
	NodeTypeInfo newInfo(strName, type);
	NodeTypeInfo* pBaseInfo = m_pTypesArray[base];
	newInfo.inheritanceGraph = pBaseInfo->inheritanceGraph;
	return AddType(newInfo);
}
Пример #8
0
bool SirenAssembly::Merge(const SirenAssembly& other)
{
	//merge references
	for (auto ref:other.mReferenceAssemblies)
	{
		AddReference(ref);
	}


	for (auto& typePair : other.mTypes)
	{
		auto* curType = FindCustomType(typePair.Key);
		if (curType == nullptr)
		{
			AddType((BaseSirenCustomType*)typePair.Value->Clone());
		}
		else
		{
			auto* otherType = typePair.Value;
			if (!curType->Merge(*otherType))
			{
				Log::FormatError("Cannot merge class:{}", typePair.Key);
				return false;
			}
		}
	}

	

	return Link();
}
Пример #9
0
void
NsUpdateMimeTypes(void)
{
    Ns_Set *set;
    int     i;

    set = Ns_ConfigGetSection("ns/mimetypes");
    if (set == NULL) {
	return;
    }

    defaultType = Ns_SetIGet(set, "default");
    if (defaultType == NULL) {
	defaultType = TYPE_DEFAULT;
    }

    noextType = Ns_SetIGet(set, "noextension");
    if (noextType == NULL) {
	noextType = defaultType;
    }

    for (i=0; i < Ns_SetSize(set); i++) {
        AddType(Ns_SetKey(set, i), Ns_SetValue(set, i));
    }
}
Пример #10
0
void Typedef(Member *td_names, Type *decl)
{
    Member *m, *t;


    m = ApplyMemberType(td_names, decl);
    while (m)
    {
        t = m->next;
        if (FindType(m->name))
        {
            int i;

            for (i = 0; i < EXTENDED_TYPES; i++)
                if (!strcmp(m->name, extended_types[i]))
                    break;
#ifdef REDEF_ERROR
            if (i == EXTENDED_TYPES)
                LexError("'%s' redefinition ignored", m->name);
#endif
            FreeMember(m);
        }
        else
        {
            AddType(NewTypedefType(m->name, m->type));
            /* Can't use FreeMember since we want to keep the name */
            free(m);
        }
        m = t;
    }
}
Пример #11
0
HFADictionary::HFADictionary( const char * pszString ) :
    nTypes(0), nTypesMax(0), papoTypes(NULL), osDictionaryText(pszString),
    bDictionaryTextDirty(FALSE)
{

/* -------------------------------------------------------------------- */
/*      Read all the types.                                             */
/* -------------------------------------------------------------------- */
    while( pszString != NULL && *pszString != '.' )
    {
        HFAType	*poNewType = new HFAType();
        pszString = poNewType->Initialize( pszString );

        if( pszString != NULL )
            AddType( poNewType );
        else
            delete poNewType;
    }

/* -------------------------------------------------------------------- */
/*      Complete the definitions.                                       */
/* -------------------------------------------------------------------- */
    for( int i = 0; i < nTypes; i++ )
    {
        papoTypes[i]->CompleteDefn( this );
    }
}
void
GFilterDragData::AddTypes
	(
	const Atom selectionName
	)
{
	AddType(kDragFilterXAtomName);
}
Пример #13
0
void ParseVarDecl()
{
  while(Token==TOK_MUL || Token==TOK_CONST || Token==TOK_VOLATILE)
  {
    Match();
    Out(" ");
  }
  if(Token==TOK_STDCALL || Token==TOK_CDECL || Token==TOK_FASTCALL || Token==TOK_WINAPI || Token==TOK_APIENTRY || Token==TOK_CALLBACK)
  {
    Match();
    Out(" ");
  }
  while(Token==TOK_MUL || Token==TOK_CONST || Token==TOK_VOLATILE)
  {
    Match();
    Out(" ");
  }
  /*
  while(Token==TOK_TYPE)
  {
    Match(TOK_TYPE);
    Match(TOK_SCOPE);
  }
  */
  if(Token==TOK_NAME)     // sometimes, we have no name!
  {
    if(intypedef)
    {
      AddType(Value);
      gottype=sTRUE;
    }
    Match(TOK_NAME);
  }
  else if(Token==TOK_OPERATOR) // operator overload
  {
    Match();
    Out(" ");
    if(Token != TOK_SOPEN)
      Match();
    else
    {
      Match();
      Match(TOK_SCLOSE);
    }
  }
  while(Token==TOK_SOPEN)
  {
    Match();
    if(Token!=TOK_SCLOSE)
      ParseExpr();
    Match(TOK_SCLOSE);
  }
  if(Token==TOK_ASSIGN)
  {
    Match(TOK_ASSIGN);
    ParseInitialiser();
  }
}
Пример #14
0
void CMimeBox::AddClicked()
{
	fAdd->SetEnabled(false);
	fChange->SetEnabled(false);
	
	AddType(fEdit->Text());
	
	ListBoxChanged();
} /* CMimeBox::AddClicked */
void
GXTextSelection::AddTypes
	(
	const Atom selectionName
	)
{
	itsGloveTextXAtom = AddType(kGloveTextDataXAtomName);
	JXTextSelection::AddTypes(selectionName);
}
Пример #16
0
const_shared_ptr<Result> MaybeType::Build(
		const shared_ptr<TypeTable> base_type_table,
		const_shared_ptr<TypeSpecifier> base_type_specifier) {
	auto definition = make_shared<TypeTable>(base_type_table);

	auto constructors = make_shared<SymbolTable>(); //TODO: generate type constructors

	auto nil_alias = make_shared<AliasDefinition>(base_type_table,
			TypeTable::GetNilTypeSpecifier(), DIRECT);
	definition->AddType(*TypeTable::GetNilName(), nil_alias);
	auto value_alias = make_shared<AliasDefinition>(base_type_table,
			base_type_specifier, DIRECT);
	definition->AddType(*MaybeTypeSpecifier::VARIANT_NAME, value_alias);

	auto maybe_type = const_shared_ptr<MaybeType>(
			new MaybeType(definition, TypeTable::GetNilName(), constructors,
					base_type_specifier));
	return make_shared<Result>(maybe_type, ErrorList::GetTerminator());
}
Пример #17
0
Atom
JXSelectionData::AddType
	(
	const JCharacter* name
	)
{
	const Atom atom = itsDisplay->RegisterXAtom(name);
	AddType(atom);
	return atom;
}
Пример #18
0
BOOL AbstractNewDialog::OnInitDialog()
{
  I7BaseDialog::OnInitDialog();
  theApp.SetIcon(this);

  // Add auto-completion to the directory edit control
  theOS.SHAutoComplete(GetDlgItem(IDC_DIR),SHACF_FILESYSTEM);

  // The create button isn't enabled until all fields are filled in
  GetDlgItem(IDOK)->EnableWindow(
    !(m_dir.IsEmpty() || m_name.IsEmpty() || m_author.IsEmpty()));

  // Adjust all texts
  AddType(this);
  AddType(GetDlgItem(IDC_DIR_TEXT));
  AddType(GetDlgItem(IDC_NAME_TEXT));

  return TRUE;
}
Пример #19
0
void CSoundChipService::AddDefaultTypes() {
	AddType(std::make_unique<CSoundChipType2A03>());
	AddType(std::make_unique<CSoundChipTypeVRC6>());
	AddType(std::make_unique<CSoundChipTypeVRC7>());
	AddType(std::make_unique<CSoundChipTypeFDS>());
	AddType(std::make_unique<CSoundChipTypeMMC5>());
	AddType(std::make_unique<CSoundChipTypeN163>());
	AddType(std::make_unique<CSoundChipTypeS5B>());
}
Пример #20
0
void LocationDlg::OnLoadAnim( wxCommandEvent &event )
{
	wxString filter = _("Polyline Data Sources");
	filter += _T("|");
	AddType(filter, FSTRING_VTAP);
	AddType(filter, FSTRING_SHP);
	AddType(filter, FSTRING_DXF);
	AddType(filter, FSTRING_IGC);

	wxFileDialog loadFile(NULL, _("Load Animation Path"), _T(""), _T(""),
		filter, wxFD_OPEN);
	bool bResult = (loadFile.ShowModal() == wxID_OK);
	if (!bResult)
		return;

	vtAnimPath *anim;
	bool bSuccess;
	wxString str = loadFile.GetPath();
	vtString filename = (const char *) str.mb_str(wxConvUTF8);
	if (GetExtension(filename) == ".vtap")
	{
		anim = CreateAnimPath();
		bSuccess = anim->Read(filename);
	}
	else
	{
		vtFeatureLoader loader;
		vtFeatureSet *pSet = loader.LoadFrom(filename);
		if (!pSet)
			return;
		anim = CreateAnimPath();
		bSuccess = anim->CreateFromLineString(m_pSaver->GetAtProjection(), pSet);
		delete pSet;
	}
	if (bSuccess)
	{
		AppendAnimPath(anim, filename);
		RefreshAnims();
	}
	else
		delete anim;
}
Пример #21
0
void
JXSelectionData::SetSelectionInfo
	(
	const Atom	selectionName,
	const Time	startTime
	)
{
	assert( selectionName != None );

	itsSelectionName = selectionName;
	itsStartTime     = startTime;

	if (selectionName != GetDNDSelectionName())
		{
		JXSelectionManager* selMgr = GetSelectionManager();
		AddType(selMgr->GetTargetsXAtom());
		AddType(selMgr->GetTimeStampXAtom());
		}

	AddTypes(selectionName);
}
Пример #22
0
void Contact::InitializeRegisters()
{
    AddType(CircleContact::Create, CircleContact::Destroy, Shape::e_circle, Shape::e_circle);
    AddType(PolygonAndCircleContact::Create, PolygonAndCircleContact::Destroy, Shape::e_polygon, Shape::e_circle);
    AddType(PolygonContact::Create, PolygonContact::Destroy, Shape::e_polygon, Shape::e_polygon);
    AddType(EdgeAndCircleContact::Create, EdgeAndCircleContact::Destroy, Shape::e_edge, Shape::e_circle);
    AddType(EdgeAndPolygonContact::Create, EdgeAndPolygonContact::Destroy, Shape::e_edge, Shape::e_polygon);
    AddType(ChainAndCircleContact::Create, ChainAndCircleContact::Destroy, Shape::e_chain, Shape::e_circle);
    AddType(ChainAndPolygonContact::Create, ChainAndPolygonContact::Destroy, Shape::e_chain, Shape::e_polygon);
}
Пример #23
0
void SampleImageDlg::OnDotDotDot( wxCommandEvent &event )
{
	wxString filter = _("All Files|*.*");
	AddType(filter, FSTRING_TIF);
	AddType(filter, FSTRING_JPEG);
	AddType(filter, FSTRING_ECW);

	// ask the user for a filename
	wxFileDialog saveFile(NULL, _("Save Imagery"), _T(""), _T(""), filter, wxFD_SAVE);
	saveFile.SetFilterIndex(0);
	bool bResult = (saveFile.ShowModal() == wxID_OK);
	if (!bResult)
		return;

	m_strToFile = saveFile.GetPath();

	// update controls
	m_bSetting = true;
	TransferDataToWindow();
	m_bSetting = false;
}
void b2Contact::InitializeRegisters()
{
	AddType(b2CircleContact::Create, b2CircleContact::Destroy, b2Shape::e_circle, b2Shape::e_circle);
	AddType(b2PolygonAndCircleContact::Create, b2PolygonAndCircleContact::Destroy, b2Shape::e_polygon, b2Shape::e_circle);
	AddType(b2PolygonContact::Create, b2PolygonContact::Destroy, b2Shape::e_polygon, b2Shape::e_polygon);
	AddType(b2EdgeAndCircleContact::Create, b2EdgeAndCircleContact::Destroy, b2Shape::e_edge, b2Shape::e_circle);
	AddType(b2EdgeAndPolygonContact::Create, b2EdgeAndPolygonContact::Destroy, b2Shape::e_edge, b2Shape::e_polygon);
	AddType(b2ChainAndCircleContact::Create, b2ChainAndCircleContact::Destroy, b2Shape::e_chain, b2Shape::e_circle);
	AddType(b2ChainAndPolygonContact::Create, b2ChainAndPolygonContact::Destroy, b2Shape::e_chain, b2Shape::e_polygon);
}
Пример #25
0
  void AbstractRoutingProfile::ParametrizeForFoot(const TypeConfig& typeConfig,
                                                  double maxSpeed)
  {
    speeds.clear();

    SetVehicle(vehicleFoot);
    SetVehicleMaxSpeed(maxSpeed);

    for (const auto &type : typeConfig.GetTypes()) {
      if (!type->GetIgnore() &&
          type->CanRouteFoot()) {
        AddType(type,maxSpeed);
      }
    }
  }
Пример #26
0
void
NsInitMimeTypes(void)
{
    int     i;

    /*
     * Initialize hash table of file extensions.
     */

    Tcl_InitHashTable(&types, TCL_STRING_KEYS);

    /*
     * Add default system types first from above
     */

    for (i = 0; typetab[i].ext != NULL; ++i) {
        AddType(typetab[i].ext, typetab[i].type);
    }
}
Пример #27
0
CMimeBox::CMimeBox(BRect r, const char *name)
	: CListBox(r, name)
{
	fPanel = NULL;

	r = fList->Frame();
	r.bottom -= 30 * gFactor;

// resize the scroller of the list

	BView *v = FindView("scroller");
	RemoveChild(v);
	delete v;
	
	fList = new BListView(r, "list", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
	fList->SetSelectionMessage(new BMessage('lbSl'));
	AddChild(new BScrollView("scroller", fList, B_FOLLOW_ALL_SIDES, 0, false, true));
	
	r.top = r.bottom + 10 * gFactor;
	r.bottom = Bounds().bottom;
	
//	r.right -= 70;
	AddChild(fEdit = new BTextControl(r, "edit mime", "Mimetype:",
		NULL, new BMessage(msg_MimeChanged)));
	
	fEdit->SetDivider(be_plain_font->StringWidth("Mimetype:") + 4);
	fEdit->SetModificationMessage(new BMessage(msg_MimeChanged));
	
	r.left = r.right + 10;
	r.right = r.left + 60;
	r.top = r.bottom - 24 * gFactor;
	AddChild(fGet = new BButton(r, "get", "Find…", new BMessage(msg_MimeFind)));
	
	fAdd->SetEnabled(false);
	fChange->SetEnabled(false);
	fDelete->SetEnabled(false);
	
	AddType("text/plain");
} /* CMimeBox::CMimeBox */
void MadFileAssociationDialog::WxButtonOKClick(wxCommandEvent& event)
{
	wxConfigBase *cfg=wxConfigBase::Get(false);
	wxString oldpath=cfg->GetPath();

	// clear old filetypes
	cfg->DeleteGroup(wxT("/AssociatedFileTypes"));

	cfg->SetPath(wxT("/AssociatedFileTypes"));

	// remove types
	int idx=0;
	int count = int(as_remove.Count());
	wxString type;
	while(idx<count)
	{
		type = as_remove[idx];
		if(DetectType(type))
		{
			RemoveType(type);
		}
		++idx;
	}

	// add types
	idx=0;
	count = int(WxListBoxAssociated->GetCount());
	while(idx<count)
	{
		type = WxListBoxAssociated->GetString(idx);
		AddType(type);
		cfg->Write(wxString()<<idx, type);
		++idx;
	}

	cfg->SetPath(oldpath);

	Close();
}
Пример #29
0
HFAType * HFADictionary::FindType( const char * pszName )

{
    for( int i = 0; i < nTypes; i++ )
    {
        if( papoTypes[i]->pszTypeName != NULL &&
            strcmp(pszName,papoTypes[i]->pszTypeName) == 0 )
            return( papoTypes[i] );
    }

/* -------------------------------------------------------------------- */
/*      Check if this is a type have other knowledge of.  If so, add    */
/*      it to the dictionary now.  I'm not sure how some files end      */
/*      up being distributed using types not in the dictionary.         */
/* -------------------------------------------------------------------- */
    for( int i = 0; apszDefDefn[i] != NULL; i += 2 )
    {
        if( strcmp( pszName, apszDefDefn[i] ) == 0 )
        {
            HFAType *poNewType = new HFAType();

            poNewType->Initialize( apszDefDefn[i+1] );
            AddType( poNewType );
            poNewType->CompleteDefn( this );

            if( osDictionaryText.size() > 0 )
                osDictionaryText.erase( osDictionaryText.size() - 1, 1 );
            osDictionaryText += apszDefDefn[i+1];
            osDictionaryText += ",.";

            bDictionaryTextDirty = TRUE;

            return poNewType;
        }
    }

    return NULL;
}
Пример #30
0
void CMimeBox::DoCancel()
{
	StChangeLB changeMe(this);
	
	int i = 0;
	
	const char *t;
	CMimeItem *m;
	
	for (int i = 0; i < fList->CountItems(); i++)
	{
		m = static_cast<CMimeItem*>(fList->ItemAt(i));
		fList->RemoveItem(i);
		delete m;
	}

	do
	{
		t = gPrefs->GetIxPrefString(prf_X_Mimetype, i++);
		if (t) AddType(t);
	}
	while (t);
} /* CMimeBox::DoCancel */