コード例 #1
0
ファイル: CodeRef.cpp プロジェクト: AbdelghaniDr/mirror
void TopicEditor::InsertItem()
{
	if(IsNull(topicpath))
		return;
	Save();
	ref.Title("Insert");
	if(ref.item.IsCursor())
		ref.item.SetFocus();
	ref.item.MultiSelect();
	ref.classlist.Show();
	int c = ref.Execute();
	if(c == IDCANCEL)
		return;
	if(c == IDYES) {
		String qtf = "&{{1 ";
		bool next = false;
		for(int i = 0; i < ref.scope.GetCount(); i++) {
			String s = ref.scope.Get(i, 1);
			if(*s != '<') {
				if(next)
					qtf << ":: ";
				qtf << DeQtf(s);
				next = true;
			}
		}
		qtf << "}}&";
		editor.PasteText(ParseQTF(qtf));
		return;
	}
	String qtf;
	if(ref.item.IsSelection()) {
		for(int i = 0; i < ref.item.GetCount(); i++)
			if(ref.item.IsSelected(i)) {
				const CppItemInfo& m = ref.GetItemInfo(i);
				qtf << CreateQtf(ref.GetCodeRef(i), m.name, m, GetLang());
			}
	}
	else
	if(ref.item.IsCursor()) {
		const CppItemInfo& m = ref.GetItemInfo();
		qtf << CreateQtf(ref.GetCodeRef(), m.name, m, GetLang());
	}
	else
		return;
	editor.BeginOp();
	editor.PasteText(ParseQTF(styles + qtf));
	editor.PrevPara();
	editor.PrevPara();
}
コード例 #2
0
ファイル: nsTextAttrs.cpp プロジェクト: AntonSilviu/v8monkey
nsLangTextAttr::nsLangTextAttr(nsHyperTextAccessible *aRootAcc, 
                               nsIContent *aRootContent, nsIContent *aContent) :
  nsTextAttr<nsAutoString>(aContent == nsnull), mRootContent(aRootContent)
{
  aRootAcc->Language(mRootNativeValue);
  mIsRootDefined =  !mRootNativeValue.IsEmpty();

  if (aContent)
    mIsDefined = GetLang(aContent, mNativeValue);
}
コード例 #3
0
ファイル: CodeRef.cpp プロジェクト: AbdelghaniDr/mirror
void TopicEditor::InsertNew(const String& coderef)
{
	const CppItem *m = GetCodeRefItem(coderef);
	if(!m)
		return;
	editor.BeginOp();
	editor.PasteText(ParseQTF(styles + CreateQtf(coderef, m->name, *m, GetLang())));
	editor.PrevPara();
	editor.PrevPara();
}
コード例 #4
0
bool BecherBuilding::StartBuilding(int gold, int wood, int stone)
{
	if (!GetLevel()->GetCash()->Add(-gold))
	{
		GetLevel()->GetPanel()->GetInfo()->Add(GetLang()->GetString(104));
		return false;
	}
	// build
	SetMode(EBM_Build);

	return true;
}
コード例 #5
0
int BecherBuilding::BuildPlace(float *pos)
{
	int ret = StatusPlace(pos);
#ifndef BECHER_EDITOR
	switch (ret)
	{
	case 0: // postavit
		GetCtrl()->SetOverColor(0xffffffff);
		break;
	case 1: // nevhodny teren
		SendGameMsgId(0, BMSG_Info, 0,(void*)GetLang()->GetString(101), 1);
		break;
	case 2: // blizko objektu
		SendGameMsgId(0, BMSG_Info, 0,(void*)GetLang()->GetString(102), 1);
		break;
	case 3:
		SendGameMsgId(0, BMSG_Info, 0,(void*)GetLang()->GetString(103), 1);
		break;
	};
#endif
	return ret;
}
コード例 #6
0
ファイル: nsTextAttrs.cpp プロジェクト: AllenDou/firefox
nsLangTextAttr::nsLangTextAttr(nsHyperTextAccessible *aRootAcc, 
                               nsIDOMNode *aRootNode, nsIDOMNode *aNode) :
  nsTextAttr<nsAutoString>(aNode == nsnull)
{
  mRootContent = do_QueryInterface(aRootNode);

  nsresult rv = aRootAcc->GetLanguage(mRootNativeValue);
  mIsRootDefined = NS_SUCCEEDED(rv) && !mRootNativeValue.IsEmpty();

  if (aNode) {
    nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
    mIsDefined = GetLang(content, mNativeValue);
  }
}
コード例 #7
0
ファイル: CLang.cpp プロジェクト: Misiaczek/amxmodx
void CLangMngr::MergeDefinitions(const char *lang, ke::Vector<sKeyDef> &tmpVec)
{
	CLang * language = GetLang(lang);
	if (language)
		language->MergeDefinitions(tmpVec);
}
コード例 #8
0
ファイル: nsTextAttrs.cpp プロジェクト: AntonSilviu/v8monkey
bool
nsLangTextAttr::GetValueFor(nsIContent *aElm, nsAutoString *aValue)
{
  return GetLang(aElm, *aValue);
}
コード例 #9
0
ファイル: CodeRef.cpp プロジェクト: AbdelghaniDr/mirror
void   TopicEditor::FixTopic()
{
	String nest;
	if(!EditText(nest, "Fix topic", "Nest"))
		return;
	CppBase& base = CodeBase();
	int q = base.Find(nest);
	if(q < 0) {
		Exclamation("Nest not found");
		return;
	}
	Array<CppItem>& n = base[q];
	Index<String> natural;
	Vector<String> link;
	for(int i = 0; i < n.GetCount(); i++) {
		const CppItem& m = n[i];
		String nat;
		if(m.virt)
			nat << "virtual ";
		if(m.kind == CLASSFUNCTION || m.kind == CLASSFUNCTIONTEMPLATE)
			nat << "static ";
		nat << m.natural;
		natural.Add(nat);
		link.Add(MakeCodeRef(nest, n[i].qitem));
	}
	RichText result;
	const RichText& txt = editor.Get();
	bool started = false;

	int l, h;
	if(editor.GetSelection(l, h)) {
		l = txt.FindPart(l);
		h = txt.FindPart(h);
	}
	else {
		l = 0;
		h = txt.GetPartCount();
	}

	for(int i = 0; i < txt.GetPartCount(); i++)
		if(txt.IsPara(i)) {
			RichPara p = txt.Get(i);
			if(i >= l && i < h) {
				WString h = p.GetText();
				String nat;
				const wchar *s = h;
				while(*s)
					if(*s == 160 || *s == ' ') {
						nat.Cat(' ');
						while(*s == 160 || *s == ' ') s++;
					}
					else
						nat.Cat(*s++);
				int q = nat.GetCount() ? natural.Find(nat) : -1;
				if(q >= 0) {
					started = true;
					const CppItem& m = n[q];
					RichText h = ParseQTF(styles + ("[s7; &]" + CreateQtf(link[q], n[q].name, m, GetLang(), true)));
					if(h.GetPartCount())
						h.RemovePart(h.GetPartCount() - 1);
					result.CatPick(pick(h));
				}
				else
				if(!started || p.GetLength())
					result.Cat(p);
			}
			else
				result.Cat(p);
		}
		else {
			RichTable b;
			b <<= txt.GetTable(i);
			result.CatPick(pick(b));
		}
	RichPara empty;
	result.Cat(empty);
	editor.BeginOp();
	editor.SetSelection(0, txt.GetLength());
	editor.PasteText(result);
}
コード例 #10
0
ファイル: nsTextAttrs.cpp プロジェクト: AllenDou/firefox
PRBool
nsLangTextAttr::GetValueFor(nsIDOMElement *aElm, nsAutoString *aValue)
{
  nsCOMPtr<nsIContent> content = do_QueryInterface(aElm);
  return GetLang(content, *aValue);
}