Ejemplo n.º 1
0
void CharsetDlg1::Del()
{
	int n = list.GetCurrent();
	if (n >=0 && n<csList.count() && csList.count() > 1 &&
			NCMessageBox((NCDialogParent*)Parent(), _LT("Del"), 
				carray_cat<char>(_LT("Delete element")," '", csList[n]->name ,"' ?").ptr(), false, bListOkCancel) == CMD_OK)
	{
		csList.del(n);
		list.SetList(csList.ptr(), csList.count());
		SaveOperCharsets();
		list.Invalidate();
	}
}
Ejemplo n.º 2
0
void CharsetDlg1::Add()
{
	charset_struct *buf[128];
	int bufCount = GetOtherCharsetList(buf, 128);

	CharsetDialog dlg( (NCDialogParent*) Parent(), 0, _LT("Add charsets"), buf, bufCount);
	int ret = dlg.DoModal();
	if (ret == CMD_OK) 
	{
		charset_struct * p =  dlg.CurrentCharset();
		if (!p) return;
		csList.append(p);
		list.SetList(csList.ptr(), csList.count());
		list.MoveCurrent(csList.count()-1);
		SaveOperCharsets();
		return;
	}
}