Outlook-like search in cxGrid - delphi

Is there anyone who know if it is possible to have a cxGrid have a searchbar like in Outlook contacts where you just press one letter and the first contact with that letter in lastname is shown?
I would love to see an example of this, but so far my search everywhere has been without result.

You can enable de Filter bar in CxGrid doing the next steps:
At the Object Inspector you must change some properties
Step 1:
At the DBTableView.FilterRow property change:
DBTableView1 - FilterRow - ApplyChanges = fracImmedialety
DBTableView1 - FilterRow - Visible = True
DBTableView1 - FilterRow - InfoText = to add the text "Click here for filter creation (for substring search, begin with * character)"
Step 2:
At the DBTableView.DataController property change:
DBTableView1 -DataController-Filter-PercentWildCards = * ( will put instead of percent a star)
DBTableView1 -DataController-Filter-Options-fcoCaseInsensitive = True (any register)
DBTableView1 -DataController-Filter-Options-fcoShowOperatorDescription = True

Related

How to remove toolbar?

I want to hide toolbar when a specific row is selected
This is the code if specific row in pickers is selected, show keyboard and input characters
if self.emailPickers[row] == "input by myself" {
email2Field.text = ""
email2Field.resignFirstResponder()
email2Field.inputView = nil
Please help me
You can use the same property for adding and removing the toolbar.
email2Field.inputAccessoryView = nil

How to do Form Customization for Unhiding Fields

I am new to Ax,I am doing an customization on form.When I click on show more fields I want to show three more fields on form which are hiding(FieldC,FieldD,FieldF).Please tell me how to achieve this Functionality.
You can check an example in form VendTable > Design > MainTab > TabPageDetails > Tab > TabGeneral > HideShowGroup.
It contains two elements: a combobox (HideShowComboBox) and a button (HideShowButton).
By default, the button has following properties:
AutoDeclaration = Yes
Text = Show more fields
HelpText = Show/hide fields.
SaveRecord = No
Border = None
BackgroundColor = Dyn Background white
ImageLocation = EmbeddedResource
NormalImage = 7886
ButtonDisplay = Text & Image left
The button also has method clicked responsible for hiding/showing the fields that need to be hidden/displayed and for changing its own look (Text, HelpText, NormalImage = 7882, etc.)
Please note that this logic is managed in class DirPartyFormHandler - you can set breakpoints there and debug the process to understand this functionality better.

How to alternate between hidden=YES and hidden=NO on a button click in iOS?

I have the hidden property set to YES on two UIViews in viewDidLoad. On a button click, they will be set to NO, therefore they will be shown. How do I make these properties switch between yes/no on every button click?
If the two views are, view1 and view2, you would set up the button to hook to an action such as the following:
-(IBAction)buttonClicked:(id)sender {
view1.hidden = !view1.hidden;
view2.hidden = !view2.hidden;
}
The ! is the logical NOT operator. So it will take the current value for hidden (whether it is true or false) and convert it to the opposite value - so, true if it was false, or false, if it was true.
It should be like this:
-(IBAction)buttonClicked:(id)sender {
drawingView.hidden = !drawingView.isHidden;
}

TEdit and focus selection works different depending on Show/showmodal

When switching focus between TEdits, the selection changes depending on the way you show the form.
When you show it with Form.show, and swith between two TEdits, the text is selected.
When you show the form with Form.Showmodal, And switch between, the cursor is at the end of the newly focused TEdit
reproduce :
Create a new form with 2 TEdits, type some text in both. Then switch between both TEdits, the whole text is selected, but when I show the form with Modal, The caret is positioned behind the text.
Why is there a difference in functionality? And where can I change it.
I found the code responsible :
procedure TStyledEdit.DoEnter;
var
Form: TCommonCustomForm;
begin
inherited;
Form := TCommonCustomForm(Root);
if not Model.IsReadOnly and Model.InputSupport and not FTextService.HasMarkedText and
((Form = nil)
//next part returns false
or (Form.FormState * [TFmxFormState.Showing] = [TFmxFormState.Showing]) or
(Form.FormState = [TFmxFormState.Engaged])) then
Edit.SelectAll
else
begin
UpdateSelectionPointPositions;
UpdateCaretPosition;
end;
end;
DoEnter is a protected method and as such you can override with your own method if you wish.
You can either do this the classic way by creating your own descendant class (with a different type name) or you can use the so-called interceptor classes as described in this link: interceptor classes.
I believed that you need to extend the if clause like this (but not tested - sorry)
if not Model.IsReadOnly and Model.InputSupport and not FTextService.HasMarkedText and
((Form = nil)
or (Form.FormState * [TFmxFormState.Showing] = [TFmxFormState.Showing])
or (Form.FormState * [TFmxFormState.Modal] = [TFmxFormState.Modal])
or (Form.FormState = [TFmxFormState.Engaged])) then

ListGrid doesn't want to set the width of the delete-button column

On a ListGrid, when you enable to remove a record there is a cross image stand on each record line.
Is it possible de resize this column ?
When I ask for the list of fields of listGrid it give me
for (ListGridField field : listGrid.getFields()) {
System.out.println("'" + field.getName() + "'");
}
A list of column name then a column whose name is "$54h"... I think it is the name for the delete button column.
But it seems that this code :
for (ListGridField field : listGrid.getFields()) {
field.setWidth("100%");
}
listGrid.getField("$54h").setWidth(60);
does not produce what I want : means my delete-button column is not 60px width.
Does anyone understand why ?
To solve this problem use
ListGridField removeFieldProperties = new ListGridField("View-delete", "Delete this record", 40);
listGrid.setRemoveFieldProperties(removeFieldProperties);

Resources