void
JXFSBindingTable::RemovePattern()
{
	JPoint cell;
	if ((GetTableSelection()).GetFirstSelectedCell(&cell))
		{
		if ((itsBindingList->GetBinding(cell.y))->IsSystemBinding())
			{
			JGetUserNotification()->ReportError(JGetString(kCantRemoveSystemBindingID));
			}
		else
			{
			CancelEditing();
			if (itsBindingList->DeleteBinding(cell.y))
				{
				RemoveRow(cell.y);
				}
			else
				{
				TableRefreshRow(cell.y);
				GetWindow()->Update();
				(JGetUserNotification())->DisplayMessage(JGetString(kReplacedBySystemID));
				}
			UpdateButtons();
			Broadcast(DataChanged());
			}
		}
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::cbDropDownListStylePropertiesChange(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->DropDownListStyle =
    (TcxEditDropDownListStyle)cbDropDownListStyle->ItemIndex;
}
void
THXVarTable::RemoveSelectedConstant()
{
	JPoint cell;
	if (GetEditedCell(&cell))
		{
		CancelEditing();
		RemoveRow(cell.y);
		itsVarList->RemoveFunction(cell.y + THXVarList::kUserFnOffset);
		}
}
void
CBCommandTable::RemoveCommand()
{
	JPoint cell;
	if ((GetTableSelection()).GetFirstSelectedCell(&cell))
		{
		CancelEditing();

		CBCommandManager::CmdInfo info = itsCmdList->GetElement(cell.y);
		info.Free();

		itsCmdList->RemoveElement(cell.y);
		RemoveRow(cell.y);
		}
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::lbUnlinkedColumnsDblClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->BeginUpdate();
  try {
    FEditProperty->ListColumns->Add()->FieldName = lbUnlinkedColumns->Items->Strings[lbUnlinkedColumns->ItemIndex];
  }
  __finally {
    FEditProperty->EndUpdate(true);
  }
  lbMoveItem(lbUnlinkedColumns, lbListColumns);
  if(lbUnlinkedColumns->Items->Count == 0)
    btnAdd->Enabled = false;
  btnDelete->Enabled = true;
  seListFieldIndex->Properties->MaxValue = lbListColumns->Items->Count - 1;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::btnDeleteClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->BeginUpdate();
  try{
    FEditProperty->ListColumns->Items[lbListColumns->ItemIndex]->Free();
  }
  __finally{
    FEditProperty->EndUpdate(true);
    ColumnsShareDemoMainForm->Grid->FocusedView->LayoutChanged(true);
  }
  lbMoveItem(lbListColumns, lbUnlinkedColumns);
  if(lbListColumns->Items->Count == 0)
    btnDelete->Enabled = false;
  btnAdd->Enabled = true;
  seListFieldIndex->Properties->MaxValue = lbListColumns->Items->Count - 1;
}
void
JXFSBindingTable::SyncWithBindingList()
{
	CancelEditing();

	const JSize dataRowCount = itsBindingList->GetElementCount();
	if (GetRowCount() < dataRowCount)
		{
		AppendRows(dataRowCount - GetRowCount());
		}
	else if (GetRowCount() > dataRowCount)
		{
		RemoveNextRows(dataRowCount+1, GetRowCount() - dataRowCount);
		}

	UpdateButtons();
	Refresh();
}
void
CBMacroSetTable::RemoveRow()
{
	assert( itsMacroIndex > 0 );

	CancelEditing();
	itsActionTable->CancelEditing();
	itsMacroTable->CancelEditing();

	CBPrefsManager::MacroSetInfo info = itsMacroList->GetElement(itsMacroIndex);
	delete info.name;
	delete info.action;
	delete info.macro;

	if (itsFirstNewID <= info.id && info.id == itsLastNewID)
		{
		itsLastNewID--;
		}
	else if (itsFirstNewID <= info.id && info.id < itsLastNewID)
		{
		JIndex index;
		const JBoolean found =
			CBPrefsManager::FindMacroID(*itsMacroList, itsLastNewID, &index);
		assert( found );

		CBPrefsManager::MacroSetInfo info2 = itsMacroList->GetElement(index);
		info2.id = info.id;
		itsMacroList->SetElement(index, info2);

		itsLastNewID--;
		}

	// itsMacroIndex must be 0 when SwitchDisplay() is called

	const JIndex macroIndex = itsMacroIndex;
	itsMacroIndex = 0;
	itsMacroList->RemoveElement(macroIndex);
	(GetStringData())->RemoveRow(macroIndex);
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::seListFieldIndexPropertiesChange(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->ListFieldIndex = seListFieldIndex->Value;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::seDropDownRowsPropertiesChange(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->DropDownRows = seDropDownRows->Value;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::chbHeadersClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->ListOptions->ShowHeader = chbHeaders->Checked;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::chbIncrementalFillteringClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->IncrementalFiltering = chbIncrementalFilltering->Checked;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::chbImmediateDropDownClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->ImmediateDropDown = chbImmediateDropDown->Checked;
}
void __fastcall TColumnsShareDemoLookupCustomizeForm::chbDropDownAutoSizeClick(
      TObject *Sender)
{
  CancelEditing();
  FEditProperty->DropDownAutoSize = chbDropDownAutoSize->Checked;
}
示例#15
0
void
JXEditTable::HandleKeyPress
	(
	const int				key,
	const JXKeyModifiers&	modifiers
	)
{
	const JBoolean shiftOn = modifiers.shift();
	const JBoolean metaOn  = modifiers.meta();

	JXWindow* window = GetWindow();

	if (key == kJReturnKey && metaOn)
		{
		EndEditing();
		}
	else if (key == kJReturnKey && shiftOn)
		{
		ShiftEditing(0,-1);
		}
	else if (key == kJReturnKey)
		{
		ShiftEditing(0,1);
		}

	else if (key == kJTabKey && shiftOn)
		{
		ShiftEditing(-1,0);
		}
	else if (key == kJTabKey)
		{
		ShiftEditing(1,0);
		}

	else if (metaOn && (key == kJUpArrow || key == '8'))
		{
		ShiftEditing(0,-1);
		}
	else if (metaOn && (key == kJDownArrow || key == '2'))
		{
		ShiftEditing(0,1);
		}
	else if (metaOn && (key == kJLeftArrow || key == '4'))
		{
		ShiftEditing(-1,0);
		}
	else if (metaOn && (key == kJRightArrow || key == '6'))
		{
		ShiftEditing(1,0);
		}

	else if (key == kJEscapeKey)
		{
		CancelEditing();
		}

	else
		{
		JXTable::HandleKeyPress(key, modifiers);
		}
}